【问题标题】:Error when trying to evaluate pertained model in tensorflow object-detection尝试在 tensorflow 对象检测中评估相关模型时出错
【发布时间】:2019-07-31 09:12:35
【问题描述】:

我正在尝试根据我的视频数据评估预训练的 tensorflow 对象部分模型。

我在这里的另一个问题中尝试了这个脚本,但它不起作用

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'

【问题讨论】:

    标签: python python-3.x tensorflow runtime-error object-detection


    【解决方案1】:

    从这个线程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
    

    让我知道它是否有效, 干杯,

    【讨论】:

    • 谢谢,这解决了这个错误,虽然现在我有一个不同的问题,但我会为此提出一个不同的问题。
    猜你喜欢
    • 2020-06-03
    • 1970-01-01
    • 2018-08-07
    • 2017-11-26
    • 2019-03-03
    • 1970-01-01
    • 2020-03-04
    • 2018-07-22
    • 1970-01-01
    相关资源
    最近更新 更多