Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow Object Detection API eval.py - 'metrics' referenced before assignment

Tensorflow Object Detection API training works flawless, but when I tried to evaluate the work by eval.py with the following command,

python3 eval.py --logtosderr --checkpoint_dir=training/ --eval_dir=eval/ --pipeline_config_path=training/faster_rcnn_inception_resnet_v2_atrous_oid.config

I got the following error,

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'

I have checked the code, 'metrics' variable should come from evaluator.py evaluate function, but because of a reason, it does not.

Thanks

like image 736
Rikbaktsa Avatar asked Oct 29 '22 21:10

Rikbaktsa


1 Answers

checkpoint_dir should be the output directory of export_inference_graph.py It contains the model.ckpt

like image 91
Mr_Optimistic Avatar answered Nov 20 '22 10:11

Mr_Optimistic