youdao-ai/SRNet

预测出错:No such file or directory: 'model_logs/vgg19/vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb'

Closed this issue · 1 comments

Hi,我预测的脚本如下:
python3 predict.py
--i_s tmp_test_data/image1_i_s.png
--i_t tmp_test_data/image1_i_t.png
--save_dir result
--checkpoint pretrained/

其中pretrained目录下是从您提供的百度网盘下载的模型,分别是:
final.data-00000-of-00001 final.index final.meta
但是执行预测的时候出错,内容如下:
WARNING:tensorflow:From /data/zhaoyanmei/projects/SRNet/model.py:95: conv2d_transpose (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.keras.layers.Conv2DTranspose instead.
WARNING:tensorflow:From /data/zhaoyanmei/projects/SRNet/model.py:205: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

Traceback (most recent call last):
File "predict.py", line 71, in
main()
File "predict.py", line 42, in main
model = SRNet(shape = cfg.data_shape, name = 'predict')
File "/data/zhaoyanmei/projects/SRNet/model.py", line 32, in init
self.build_whole_net_with_loss()
File "/data/zhaoyanmei/projects/SRNet/model.py", line 207, in build_whole_net_with_loss
with open(vgg_graph_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'model_logs/vgg19/vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb'
[root@95cb833b1f86 SRNet]# vi predict.sh

请问一下,vgg19_weights_tf_dim_ordering_tf_kernels_notop.pb不是训练的时候才会用的么?为什么预测的时候也要加载这个vgg19的模型呢?

i find it ...