【发布时间】:2021-09-10 17:26:25
【问题描述】:
我正在研究 google colab 中的对象检测模型,我正在遵循here 概述的大部分说明。
为了训练模型,我尝试使用:
!python model_main_tf2.py
!python --model_dir=models/SSD_640
!python --pipeline_config_path=models/SSD_640/pipeline.config
但是,我收到以下错误:
/content/drive/MyDrive/Workspace
2021-06-28 11:33:33.510377: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
File "model_main_tf2.py", line 32, in <module>
from object_detection import model_lib_v2
ImportError: cannot import name 'model_lib_v2' from 'object_detection' (/usr/local/lib/python3.7/dist-packages/object_detection/__init__.py)
提到的文件model_lib_v2.py在以下路径中可用 - Workspace/models/research/model_lib_v2.py
我尝试使用代码调整 cd 以指向工作区文件夹:
%cd '/content/drive/MyDrive/Workspace'
我也一直在尝试通过再次安装object_detection 来修复它,但这并没有帮助。我还确保路径是正确的,并且似乎没有任何不一致之处。
对此的任何帮助将不胜感激!提前致谢。
【问题讨论】:
标签: python tensorflow google-colaboratory tensorflow2.0 object-detection