Tensorflow,我的评估运行一次

时间:2018-07-12 09:20:59

标签: python tensorflow eval object-detection

我正在使用tensorflow object_detection eval.py评估我的训练课程。但是评估仅在我目录中的最后一个检查点运行一次。

这是我的命令:

python object_detection/eval.py \
     --logtostderr \
     --pipeline_config_path=/home/atu/Bureau/ML-DOTA/pre_trained_models/iteration_2/faster_rcnn_resnet50_coco_2018_01_28/pipeline.config \
     --checkpoint_dir=/home/atu/Bureau/ML-DOTA/second_struct/dota_train/ \
     --eval_dir=/home/atu/Bureau/ML-DOTA/second_struct/dota_eval

这是我使用它后得到的:

/home/atu/Bureau/models/research/object_detection/utils/visualization_utils.py:25: UserWarning:
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'TkAgg' by the following code:
  File "object_detection/eval.py", line 50, in <module>
    from object_detection import evaluator
  File "/home/atu/Bureau/models/research/object_detection/evaluator.py", line 24, in <module>
    from object_detection import eval_util
  File "/home/atu/Bureau/models/research/object_detection/eval_util.py", line 28, in <module>
    from object_detection.metrics import coco_evaluation
  File "/home/atu/Bureau/models/research/object_detection/metrics/coco_evaluation.py", line 20, in <module>
    from object_detection.metrics import coco_tools
  File "/home/atu/Bureau/models/research/object_detection/metrics/coco_tools.py", line 47, in <module>
    from pycocotools import coco
  File "/usr/local/lib/python2.7/dist-packages/pycocotools/coco.py", line 49, in <module>
    import matplotlib.pyplot as plt
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 71, in <module>
    from matplotlib.backends import pylab_setup
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 16, in <module>
    line for line in traceback.format_stack()


  import matplotlib; matplotlib.use('Agg')  # pylint: disable=multiple-statements
('nbr eval:', 10)
WARNING:tensorflow:num_readers has been reduced to 1 to match input file shards.
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.
WARNING:tensorflow:From /home/atu/Bureau/models/research/object_detection/core/box_predictor.py:407: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
INFO:tensorflow:Scale of 0 disables regularizer.
WARNING:tensorflow:From /home/atu/Bureau/models/research/object_detection/core/losses.py:317: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

INFO:tensorflow:Restoring parameters from /home/atu/Bureau/ML-DOTA/second_struct/dota_train/model.ckpt-539
INFO:tensorflow:Restoring parameters from /home/atu/Bureau/ML-DOTA/second_struct/dota_train/model.ckpt-539
^CScores and tpfp per class label: 0
[1. 1. 0. 1. 1. 1. 1. 1. 0. 1. 1. 1. 1.]
[0.91606104 0.87944895 0.30894434 0.71059531 0.63051593 0.58756334
 0.5470503  0.87907678 0.6699332  0.46115178 0.69580519 0.60633844
 0.82578725]
Traceback (most recent call last):
  File "object_detection/eval.py", line 147, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "object_detection/eval.py", line 143, in main
    graph_hook_fn=graph_rewriter_fn)
  File "/home/atu/Bureau/models/research/object_detection/evaluator.py", line 276, in evaluate
    losses_dict=losses_dict)
  File "/home/atu/Bureau/models/research/object_detection/eval_util.py", line 426, in repeated_checkpoint_run
    losses_dict=losses_dict)
  File "/home/atu/Bureau/models/research/object_detection/eval_util.py", line 297, in _run_checkpoint_once
    tensor_dict, sess, batch, counters, losses_dict=losses_dict)
  File "/home/atu/Bureau/models/research/object_detection/evaluator.py", line 215, in _process_batch
    result_dict, result_losses_dict = sess.run([tensor_dict, losses_dict])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 900, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1135, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1316, in _do_run
    run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1322, in _do_call
    return fn(*args)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
    run_metadata)
KeyboardInterrupt

如您所见,我需要手动终止该进程,因为它没有继续进行。评估是在最后一个检查点文件上完成的,而不是在目录中所有可用文件上完成的。

0 个答案:

没有答案