I study CNN classification with TensorFlow v0.12 and then want to create labels for new data using a trained model.
At the end of the training script, I added these lines of code:
saver = tf.train.Saver()
save_path = saver.save(sess,'/home/path/to/model/model.ckpt')
After completing the training, the files in the folder are as follows: 1. control point; 2. model.ckpt.data-00000-of-00001; 3. model.ckpt.index; 4. model.ckpt.meta p>
Then I tried to restore the model using the .meta file. Following this tutorial , I added the following line to my classification code:
saver=tf.train.import_meta_graph(savepath+'model.ckpt.meta') #line1
and then:
saver.restore(sess, save_path=savepath+'model.ckpt')
Before this change, I needed to plot the graph again, and then write (instead of line1):
saver = tf.train.Saver()
, line1, , . , , :
predictions = sess.run(y_conv, feed_dict={x: patches,keep_prob: 1.0})
y_conv. ? , , ?
, , . ...
, , ! Roi.