执行如下代码。加载以前保存的训练好的模型参数。比如已经有训练好的多个模型,我删除当前最新的那个,则按照理论来说,之前倒数第二新的现在就应该是最新的了,然后,代码应该读取当前的这个模型,但是,运行会出现如下错误:
NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for model/model.ckpt-41
-*- coding: utf-8 -*
====================
import time
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
加载mnist_inference.py 和 mnist_train.py中定义的常量和函数
import LeNet5_inference
import LeNet5_train
每10秒加载一次最新的模型, 并在测试数据上测试最新模型的正确率
EVAL_INTERVAL_SECS = 10