ModuleNotFoundError:没有名为"utils"的模块 [英] ModuleNotFoundError: No module named 'utils'
问题描述
我正在尝试使用网络摄像头作为输入在Tensorflow中运行object_detection API.
I'm trying to run the object_detection API in Tensorflow using my webcam as an input.
错误说:从utils导入label_map_util ModuleNotFoundError:没有名为'utils'的模块"
The error says: "from utils import label_map_util ModuleNotFoundError: No module named 'utils'"
与以下几行相关:
from utils import label_map_util
from utils import visualization_utils as vis_util
我尝试过"pip install util"似乎可以工作,但不能解决问题.我还重新安装了多个版本的protobuf,因为其他在线问题似乎将其作为解决方案.安装protoc时没有任何错误,所以我不认为这是问题所在.
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.
我在Windows 10上使用tensorflow-gpu使用python 3.6.
I'm using python 3.6 on windows 10 with tensorflow-gpu.
推荐答案
您要从哪个文件夹运行python脚本?
What folder are you running your python script from?
要能够直接访问"utils"模块,您需要在<models-master>\research\object_detection
文件夹中运行脚本.
To be able to access the 'utils' module directly, you need to be running the script inside the <models-master>\research\object_detection
folder.
这篇关于ModuleNotFoundError:没有名为"utils"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!