我已经正确安装了Tensorflow对象检测API。给定默认的.config文件,我可以在数据集上成功运行训练阶段。但是,一段时间后,我收到此错误:
Traceback (most recent call last):
File "model_main.py", line 101, in <module>
tf.app.run()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "model_main.py", line 97, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/training.py", line 447, in train_and_evaluate
return executor.run()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/training.py", line 531, in run
return self.run_local()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/training.py", line 681, in run_local
eval_result, export_results = evaluator.evaluate_and_export()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/training.py", line 886, in evaluate_and_export
hooks=self._eval_spec.hooks)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/estimator.py", line 453, in evaluate
input_fn, hooks, checkpoint_path)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/estimator.py", line 1348, in _evaluate_build_graph
features, labels, model_fn_lib.ModeKeys.EVAL, self.config)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/estimator.py", line 1107, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/giacomo/OR/models/research/object_detection/model_lib.py", line 422, in model_fn
scaffold=scaffold)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/estimator/model_fn.py", line 225, in __new__
metric_value_and_update, key))
TypeError: Values of eval_metric_ops must be (metric_value, update_op) tuples, given: name: "PyFunc"
TypeError: Values of eval_metric_ops must be (metric_value, update_op) tuples, given: name: "PyFunc"
op: "PyFunc"
input: "ExpandDims_6"
input: "ExpandDims_7"
input: "ExpandDims_8"
input: "ExpandDims_9"
input: "strided_slice_12"
input: "ExpandDims_10"
input: "ExpandDims_11"
input: "ExpandDims_12"
input: "strided_slice_13"
attr {
key: "Tin"
value {
list {
type: DT_INT32
type: DT_FLOAT
type: DT_INT64
type: DT_BOOL
type: DT_INT32
type: DT_FLOAT
type: DT_FLOAT
type: DT_INT64
type: DT_INT32
}
}
}
attr {
key: "Tout"
value {
list {
}
}
}
attr {
key: "token"
value {
s: "pyfunc_2"
}
}
for key: Tensor("PyFunc_2:0", dtype=float32)
检查火车目录我可以说训练很好(我可以在目录中看到检查点文件),但是由于这个问题,Tensorflow无法运行评估。即使运行Tensorboard,我也可以看到损失函数,但看不到评估结果。