Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow Object Detection API on Windows - ImportError: No module named "object_detection.utils"; "object_detection" is not a package

I am using the tensorflow object detection api from https://github.com/tensorflow/models and I am trying to make an object detection program using open cv with tensorflow. When the code reaches at line 30 (see code below), the program will get an error and will print:

Traceback (most recent call last):

File "C:\Users\xxx\Documents\models\research\object_detection\object_detection.py", line 31, in from object_detection.utils import ops as utils_ops

File "C:\Users\xxx\Documents\models\research\object_detection\object_detection.py", line 31, in from object_detection.utils import ops as utils_ops

ImportError: No module named 'object_detection.utils'; 'object_detection' is not a package

I tried the solutions that are in this link (Tensorflow Object Detection API on Windows - error "ModuleNotFoundError: No module named 'utils'") step by step, but it still didn't work. I don't know what should be targeted in order to solve this problem. Also, I am not that familiar with machine learning, tensorflow, and opencv, I just start learning it now. Can anyone please help me with this? Thanks in advance.

Btw, this is the part of the code where I got a problem with.

# 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
like image 996
gta Avatar asked Oct 17 '25 11:10

gta


1 Answers

I tried the 'export path' method on python and the 'Develop' method for Conda but nothing worked. Finally tried installing this API and the tutorial worked. Maybe I missed this step during the installation. You try this too

pip install tensorflow-object-detection-api
like image 119
Akshay Nair Avatar answered Oct 18 '25 23:10

Akshay Nair



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!