python - Issue with Restoring tensorflow graph -
i build neural net tensorflow, , saved after training, when want restore in order make prediction, doesn't work that's get:
2017-09-10 22:51:58.530272: w c:\tf_jenkins\home\workspace\release- win\m\windows\py\36\tensorflow\core\framework\op_kernel.cc:1158] not found: key variable_10 not found in checkpoint key variable_10 not found in checkpoint
i don't know issue, here's save file:
model_file = "c:/users/ben-n_000/desktop/travail signal_courant/signal_courant_new/tensorflow_model/model.ckpt"
i saved model properly
saver = tf.train.saver() saver.save(sess, model_file)
and here comes issue :
tf.session() sess: sess.run(tf.global_variables_initializer()) saver = tf.train.saver() saver.restore(sess, model_file)
it's quite frustrating, can't understand what's issue, need help, thnaks.
i have 2 functions train_network , make_prediction, saving model , reusing in make_prediction function that's how works
def train_neural_network(x): ''' code here ''' #saver before innitalizing alla variables saver = tf.train.saver() tf.session() sess: sess.run(tf.global_variables_initializer()) ''' code here ''' def make_prediction(z): ''' code here ''' tf.session() sess: sess.run(tf.global_variables_initializer()) saver.restore(sess, model_file) ''' code here '''
and here @ end of code can call our functions , put saver before calling of make_prediction :
train_neural_network(x) saver = tf.train.saver() make_prediction(x_test[1])
Comments
Post a Comment