大佬教程收集整理的这篇文章主要介绍了导入错误:无法从“object_detection”导入名称“model_lib_v2”,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在 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)
提到的文件 @H_33_7@model_lib_v2.py 位于以下路径 - Workspace/models/research/model_lib_v2.py
我已经尝试使用以下代码将 cd 调整为指向工作区文件夹:
%cd '/content/drive/MyDrive/Workspace'
我也一直试图通过@R_311_10696@ object_detection
来修复它,但这并没有帮助。我还确保路径正确,并且似乎没有任何不一致之处。
对此的任何帮助将不胜感激!提前致谢。
尝试添加到 PYTHONPATH。
您可以从这里获取文件。
https://github.com/tensorflow/models/tree/master/research/object_detection
以上是大佬教程为你收集整理的导入错误:无法从“object_detection”导入名称“model_lib_v2”全部内容,希望文章能够帮你解决导入错误:无法从“object_detection”导入名称“model_lib_v2”所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。