【发布时间】:2018-08-14 01:55:46
【问题描述】:
我正在使用来自https://github.com/tensorflow/models 的 tensorflow 对象检测 api,并且我正在尝试使用带有 tensorflow 的 open cv 来制作对象检测程序。当代码到达第 30 行时(见下面的代码),程序会出错并打印:
Traceback(最近一次调用最后一次):
文件“C:\Users\xxx\Documents\models\research\object_detection\object_detection.py”,第 31 行,在 from object_detection.utils import ops as utils_ops
文件“C:\Users\xxx\Documents\models\research\object_detection\object_detection.py”,第 31 行,在 from object_detection.utils import ops as utils_ops
ImportError: 没有名为“object_detection.utils”的模块; “object_detection”不是一个包
我逐步尝试了此链接 (Tensorflow Object Detection API on Windows - error "ModuleNotFoundError: No module named 'utils'") 中的解决方案,但仍然无法正常工作。我不知道应该针对什么来解决这个问题。另外,我对机器学习、tensorflow和opencv不太熟悉,我现在才开始学习。谁能帮我解决这个问题?提前致谢。
顺便说一句,这是我遇到问题的代码部分。
# This is needed since the notebook is stored in the object_detection folder.
sys.path.append("..")
from object_detection.utils import ops as utils_ops
【问题讨论】:
标签: python opencv tensorflow machine-learning