youdao-ai/SRNet

预测时模型加载失败

Closed this issue · 2 comments

错误提示如下:
Traceback (most recent call last):
File "predict.py", line 71, in
main()
File "predict.py", line 51, in main
saver.restore(sess, args.checkpoint)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1286, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
run_metadata)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file model_logs/vgg19/vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
[[node save/RestoreV2 (defined at predict.py:47) ]]

Original stack trace for 'save/RestoreV2':
File "predict.py", line 71, in
main()
File "predict.py", line 47, in main
saver = tf.train.Saver(tf.global_variables())
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 825, in init
self.build()
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 837, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 875, in _build
build_restore=build_restore)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 508, in _build_internal
restore_sequentially, reshape)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 328, in _AddRestoreOps
restore_sequentially)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 575, in bulk_restore
return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1696, in restore_v2
name=name)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/home/work/software/anaconda2/envs/py3.6_tf1.14/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()
麻烦帮忙看一下

你好,请问你在checkpoint后面写的是不是vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb这个模型的路径?

这个vgg19的模型是用来训练的,提供一部分loss(论文中叫VGG-Loss),在预测的时候不需要加载。

我们目前没有在项目中提供预训练模型,但这周会更新项目,加入预训练模型和生成训练数据的代码。

你好,请问你在checkpoint后面写的是不是vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb这个模型的路径?

这个vgg19的模型是用来训练的,提供一部分loss(论文中叫VGG-Loss),在预测的时候不需要加载。

我们目前没有在项目中提供预训练模型,但这周会更新项目,加入预训练模型和生成训练数据的代码。

原来是这样子,我以为这个模型是已经训练好的了。。那就期待作者能提供一个预测模型,这样子可以让我们自己测试看下效果啦~感谢!