ModuleNotFoundError: No module named 'object_detection'

Try install Tensorflow Object Detection Library Packaged

pip install tensorflow-object-detection-api

Cause of this error is installing object_detection library, So one of the solution which can work is running the below command inside models/research


    sudo python setup.py install

If such solution does not work, please execute the below command one by one in the directory models/research


    export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
    sudo python setup.py install

I hope this will work. I also faced the same problem while creating model from export_inference_graph.py. It worked for me.


You need to export the environmental variables every time you open a new terminal in that environment.

Please note that there are are back quotes on each of the pwd in the command as this might not be showing in the command below. Back quote is the same as the tilde key without pressing the shift key (US keyboard).

From tensorflow/models/research/

export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

Tags:

Python