EdjeElectronics / TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

How to train a TensorFlow Object Detection Classifier for multiple object detection on Windows
Apache License 2.0
2.93k stars 1.3k forks source link

Error: no module named object_detection #68

Open TomSala opened 6 years ago

TomSala commented 6 years ago

I've just arrived to the training step but, trying to initialize it (python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config) it returns this error: from object_detection import trainer ImportError: No module named 'object_detection'. I alsoadded both models and slim to a env variable named PYTHON PATH (c:\obj\models; c:\obj\models\slim), where are actually these folders.

patrickmlaw commented 6 years ago

I think you need to set the path for all three folders - models, models/research and models/research/slim

ex,

set PYTHONPATH=C:\tensorflow1\models;C:\tensorflow1\models\research;C:\tensorflow1\models\research\slim

TomSala commented 6 years ago

@patrickmlaw no it still doesn't work

uthiraa commented 6 years ago

@TomSala Make sure you run this when you are in the object_detection folder in your anaconda prompt. If this does not work too, try the following by running this following command from the research folder. SET PYTHONPATH=%cd%;%cd%\slim (if you use Windows) or export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim(if you use Linux)

CBHealth commented 6 years ago

I just did it the hard way and went through all folders to delete the object_detection. in every file. It worked. If you want I can upload the new version on my github account. I work with linux 16.04.

TomSala commented 6 years ago

Yes, thank you!