I'm trying to run the object_detection API in Tensorflow using my webcam as an input.
The error says: "from utils import label_map_util ModuleNotFoundError: No module named 'utils'"
Which relates to the lines:
from utils import label_map_util
from utils import visualization_utils as vis_util
I've tried "pip install util" appears to work but doesn't solve the problem. I have also reinstalled multiple versions of protobuf as other questions online appear to have this as the solution. I don't get any errors when I install protoc so I don't think this is the issue.
I'm using python 3.6 on windows 10 with tensorflow-gpu.
6条答案
按热度按时间neekobn81#
将object_detection添加到utils的前面:
5fjcxozz2#
你从哪个文件夹运行你的python脚本?
为了能够直接访问“utils”模块,您需要运行
<models-master>\research\object_detection
文件夹中的脚本。qnzebej03#
/home/dc-335/文档/软件/tensorflow /模型/研究/对象检测
qvtsj1bj4#
我用了一个更快的方法来修复它。
我从 models\research\object_detection 中复制了 utils 文件夹,并将其粘贴到需要 utils 的python文件所在的目录中
4c8rllxm5#
安装没有完成,你会注意到你的项目文件夹中没有名为model_utils的模块。卸载它
pip uninstall django-model-utils
然后再次安装pip install django-model-utils
在你的项目文件夹中安装一个名为model_utils的新应用程序。hk8txs486#
我用快速的方法
!pip安装实用程序
它工作正常