我正在尝试使用在https://github.com/shahrukhqasim/TIES-2.0中实现的模型来查找“文档”中图像中的行和列。他们将带注释的(针对行和列的)表转换为tfrecord,然后使用Tensorflow训练CNN。在训练期间,对输出文件的配置设置如下:
summary_path=C:\projects\testing\TIES-2.0\python\summary4\
model_path=C:\projects\testing\TIES-2.0\python\mdl4\
test_out_path=C:\projects\testing\TIES-2.0\python\test4\
profiler_output_file_name=C:\projects\testing\TIES-2.0\python\profiler4
visual_feedback_out_path=C:\projects\testing\TIES-2.0\python\visual_feedback4
培训顺利完成后,我在文件夹C:\projects\testing\TIES-2.0\python\mdl4\
中创建了以下文件:
和同一目录中的单独summary4
文件夹,该文件夹具有以下输出(训练进行了三遍):
test4
文件夹为空,visual_feedback4
的pdf内部带有注释。
使用先前在github(how to predict with .meta and checkpoint files in tensorflow?和Use .ckpt and .meta -files to make predictions with Inception in TensorFlow)上回答的问题,我尝试了以下代码来恢复模型以进行预测:
import tensorflow.compat.v1 as tf
model_path = r"C:\projects\testing\TIES-2.0\python\mdl4"
detection_graph = tf.Graph()
with tf.Session(graph=detection_graph) as sess:
# Load the graph with the trained states
loader = tf.train.import_meta_graph(model_path+'\.meta')
#loader.restore(sess, model_path)
loader.restore(sess, r"C:\projects\testing\TIES-2.0\python\mdl4\.checkpoint.ckpt")
哪个立即给我错误:
ValueError: The passed save_path is not a valid checkpoint: C:\projects\testing\TIES-2.0\python\mdl4\.checkpoint.ckpt
已尝试将文档中的另一个文件用作loader.restore
的参数,因为loader
本身运行没有问题。感谢您的帮助,已经有一个星期了。