I am trying to create an executable program with a trained tensorflow model. However, I have realised that the compiled Go script will need the model directory path as an argument. To avoid this I would like to include the model in the Go executable and compile them together. I have been looking at go-bindata
but that doesn't work in this case because the function tf.LoadSavedModel
takes a directory path to load the model, not the actual model files.
Do you know how this could be done?
EDIT:
tf.LoadSavedModel
function (https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go#LoadSavedModel) needs the path of a directory to load a model. It is not able to process individual files, so thats why go-bindata (which is the solution of that question) doesn't work in this case. tf.LoadSavedModel
uses a function in C
to load files in a directory, so the files cannot be provided directly to Go. I hope that I explained it correctly