raccoon_dataset icon indicating copy to clipboard operation
raccoon_dataset copied to clipboard

ModuleNotFoundError: No module named 'object_detection'

Open LeeyMessi opened this issue 7 years ago • 15 comments

I am using Win10 and Spyder, I have tried to run : generate_tfrecord.py, Unfortunately,shows "ModuleNotFoundError: No module named 'object_detection'", I guess the problem is the path, how to set the path in spyder?

LeeyMessi avatar Jun 19 '18 13:06 LeeyMessi

I'm hitting this hurdle too. Same environment.

lidderdj avatar Jun 21 '18 22:06 lidderdj

not sure concerning windows, but on Ubuntu you have to deploy object detection module by running setup.py from the research folder, then set PYTHONPATH accordingly please check the tensorflow github for the correct run command configuration

Insertfunnylogin avatar Jul 04 '18 09:07 Insertfunnylogin

on win10 go to ( \model master\models-master\research) open cmd in this path and type python setup.py install it should work

D0o0D avatar Jul 28 '18 06:07 D0o0D

I've managed to solve this problem in my system (win 10). The solution is not very straightforward but here :

  1. First u need to clone Tensorflow Object Detection API repository https://github.com/tensorflow/models.
  2. Follow the installation provided in https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md
  3. In the step 2, you are required to compile protobuf library, so download the protobuf compiler at https://github.com/google/protobuf/releases/latest (at the time of this writing (3.5.1), there's a bug in protoc which may or may not related to the Windows environment, my solution is use the protoc v 3.4.0)
  4. Append the PYTHONPATH environment variable with the directory of <your cloned tensorflow object detection api>/research/ and <your cloned tensorflow object detection api>/research/slim (dont forget to add the PYTHONPATH to Path if you haven't done so.
  5. No more ModuleNotFoundError: No module named 'object_detection'

agriardyan avatar Aug 02 '18 11:08 agriardyan

on win10 go to ( \model master\models-master\research) open cmd in this path and type python setup.py install it should work

Thank you. It worked. (y)

mbhurtel avatar Jul 11 '19 14:07 mbhurtel

please show me the path of win 10 go to ( \model master\models-master\research) im newbie

vanhoangns123 avatar Aug 06 '19 02:08 vanhoangns123

on win10 go to ( \model master\models-master\research) open cmd in this path and type python setup.py install it should work

Thank you. It worked. (y)

Me too! Thanks

yo-carthy avatar Oct 03 '19 13:10 yo-carthy

on win10 go to ( \model master\models-master\research) open cmd in this path and type python setup.py install it should work

is that path is found in Tensorflow Object Detection API repository ???

shiko10 avatar Nov 20 '19 22:11 shiko10

Hi, you have to do the following commands to make it work for you : protoc object_detection/protos/*.proto --python_out=. Add the following to your ~/.bashrc : export PYTHONPATH=$PYTHONPATH:<PATH_TO_TF>/TensorFlow/models/research/object_detection:<PATH_TO_TF>/TensorFlow/models/research:<PATH_TO_TF>/TensorFlow/models/research/slim

raedkit avatar Dec 15 '19 13:12 raedkit

thank you its literally worked

yashmodi123 avatar Jan 28 '20 16:01 yashmodi123

pip install tensorflow-object-detection-api

systems-apatrick avatar Jan 31 '20 22:01 systems-apatrick

Adding the full path to the object detection module solved the error in my case

import sys sys.path.append(..../full_path_to_object_detection_module/)

ShahirAnsari avatar May 14 '20 07:05 ShahirAnsari

pip install tensorflow-object-detection-api

it did work, thanks so much

armansamimi avatar Jun 08 '20 12:06 armansamimi

Hi, I am getting the following errors.. when I run the main training program.. (tensorflow) C:\tensorflow\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config Traceback (most recent call last): File "train.py", line 54, in from object_detection.builders import model_builder File "C:\tensorflow\models\research\object_detection\builders\model_builder.py", line 20, in from object_detection.builders import anchor_generator_builder File "C:\tensorflow\models\research\object_detection\builders\anchor_generator_builder.py", line 23, in from object_detection.anchor_generators import flexible_grid_anchor_generator ModuleNotFoundError: No module named 'object_detection.anchor_generators'

Jayanth1812 avatar Nov 08 '20 10:11 Jayanth1812

i got this error while i was trying to run this code. and i have already installed tensorflow package from conda. what shuld i di to solve this error?


ModuleNotFoundError Traceback (most recent call last) in 1 import tensorflow as tf ----> 2 from object_detection.utils import config_util 3 from object_detection.protos import pipeline_pb2 4 from google.protobuf import text_format

ModuleNotFoundError: No module named 'object_detection'

zeelsheladiya avatar May 26 '21 05:05 zeelsheladiya