Tensorflow对象检测API培训完美无瑕,但当我尝试使用以下命令通过eval.py评估工作时,
python3 eval.py --logtosderr --checkpoint_dir=training/ --eval_dir=eval/ --pipeline_config_path=training/faster_rcnn_inception_resnet_v2_atrous_oid.config
我收到了以下错误,
paperspace@psnu680y1:~/models-master/research/object_detection$ python3 eval.py --logtostderr --checkpoint_dir = training/ --eval_dir=eval/ --pipeline_config_path=training/faster_rcnn_inception_resnet_v2_atrous_oid.config
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
Traceback (most recent call last):
File "eval.py", line 133, in <module>
tf.app.run()
File "/home/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "eval.py", line 129, in main
FLAGS.checkpoint_dir, FLAGS.eval_dir)
File "/home/paperspace/models-master/research/object_detection/evaluator.py" line 210, in evaluate
save_graph_dir=(eval_dir if eval_config.save_graph else ''))
File "/home/paperspace/models-master/research/object_detection/eval_util.py", line 393, in repeated_checkpoint_run
return metrics
UnboundLocalError: local variable 'metrics' referenced before assignment'
我已检查过代码,&#39;指标&#39;变量应来自evaluateator.py evaluate函数,但由于某种原因,它不会。
由于
答案 0 :(得分:1)
checkpoint_dir应该是export_inference_graph.py的输出目录 它包含model.ckpt