I'm relatively new to machine learning and the Tensorflow framework. I was trying to take my trained model heavily influenced by the code presented here, using the MNIST handwritten digit dataset and perform inferences on testing examples that I have created. However, I am doing the training on a remote machine with a GPU and am trying to save the data to a directory so that I can transfer the data and inference on a local machine
It seems that I was able to save some of the model with tf.saved_model.simple_save
, however, I'm unsure of how to use the saved data to do inferencing and to use the data to make a prediction given a new image. It seems like there are multiple ways to save a model, but I am unsure of what the convention or of what the "correct way" is to do it with the Tensorflow framwork.
So far, this is the line that I think I would need, but am unsure if it is correct.
tf.saved_model.simple_save(sess, 'mnist_model',
inputs={'x': self.x},
outputs={'y_': self.y_, 'y_conv':self.y_conv})
If someone could point me in the direction of how to properly save trained models and which variables to use to be able to inference using the saved model, I'd really appreciate it.