简体   繁体   中英

Using Tensor Flow CNN for prediction

I am new to tensorflow. I have manged to train and validate a CNN, saved the session through the Saver object into a CPKT file and loaded it back. Now I'd like to use the trained model in order to check how it performs against a photo I took myself. I can't figure out how to do it.

  • Use a tf.train.Saver() object

    saver = tf.train.Saver() with tf.Session() as sess: saver.restore(sess, tf.train.latest_checkpoint('./'))

Great to hear! All you need to do is to load the checkpoint , and evaluate the network against it. That is typically done using the same script as the training script, but only evaluating the loss function with a batch size of 1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM