尝试评估张量流对象检测中的相关模型时出错

Error when trying to evaluate pertained model in tensorflow object-detection

我正在尝试在我的视频数据上评估预训练的张量流对象部分模型。

我在此处的另一个问题中尝试过此脚本,但它不起作用

python
/Users/user_name/PycharmProjects/ObjDectCount/Tensorflow/models/research/object_detection/legacy/eval.py --logtostderr --checkpoint_dir=test_ckpt --eval_dir=/Users/Documents/1426-1200reduced.avi   --pipelineline_config_path=/samples/configs/ssd_inception_v2_coco.config

这是我在尝试 运行 脚本时遇到的错误:

Traceback (most recent call last):
  File "/Users/user_name/PycharmProjects/ObjDectCount/Tensorflow/models/research/object_detection/legacy/eval.py", line 51, in <module>
    from object_detection.builders import model_builder
  File "/Users/user_name/.conda/envs/ObjDectCount/lib/python3.7/site-packages/object_detection-0.1-py3.7.egg/object_detection/builders/model_builder.py", line 35, in <module>
    from object_detection.models import faster_rcnn_inception_resnet_v2_feature_extractor as frcnn_inc_res
  File "/Users/user_name/.conda/envs/ObjDectCount/lib/python3.7/site-packages/object_detection-0.1-py3.7.egg/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py", line 28, in <module>
    from nets import inception_resnet_v2
ModuleNotFoundError: No module named 'nets'

从这个帖子 https://github.com/tensorflow/models/issues/1842 看来,您没有将正确的路径添加到您的 python 环境中。我不确定你在哪里安装了你的,但我的在这里:~/Documents/TensorFlow/models/research/slim。确保将此路径添加到您的 PYTHONPATH 变量中。请注意,您还需要模型目录,这应该可以解决问题:

export PYTHONPATH=$PYTHONPATH:~/Documents/TensorFlow/models/:~/Documents/TensorFlow/models/research/slim

如果有效请告诉我, 干杯,