Waiting for .../output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt

来源:互联网 发布:js精粹 编辑:程序博客网 时间:2024/05/29 09:09

在跑faster-rcnn_tf时,训练代码的结尾会运行测试代码,但是重复出现了如下错误:


Waiting for TEST_FRCN_ROOT/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt to exist...

Waiting for TEST_FRCN_ROOT/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt to exist...

Waiting for TEST_FRCN_ROOT/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt to exist...

Waiting for TEST_FRCN_ROOT/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt to exist...

...


原因很简单,tensorflow V2版本中修改了checkpoint格式,输出由原来的.ckpt+.meta两个文件变成了.ckpt.data-00000-of-00001.index.meta三个文件,而test仍然按照V1的格式读取,所以一直在重复等待70000.ckpt生成


修改也很简单,将train.py中第261行修改一下,我之前是V2,改成V1

saver = tf.train.Saver(max_to_keep=100, write_version=saver_pb2.SaverDef.V1)

就行了

参考:https://github.com/smallcorgi/Faster-RCNN_TF/issues/161


也许你的问题是 Error in 'run script to train and test model'

那是我之前遇到的,也是同样的地方,由于tensorflow增加到3种checkpoint的存储方式而非原来的一种,所以需要修改saver的参数同样是上面的代码处

self.saver = tf.train.Saver(max_to_keep=100) 改成 self.saver = tf.train.Saver(max_to_keep=100,write_version=saver_pb2.SaverDef.V1)

前面别忘了引用一句

from tensorflow.core.protobuf import saver_pb2

就行了

参考 https://github.com/smallcorgi/Faster-RCNN_TF/issues/79#issuecomment-279273421

原创粉丝点击