When run train.py in object_detection, then "deployment" cannot be found ?
Traceback (most recent call last):
File "train.py", line 51, in
Please follow the object detection API installation instructions, which will add the deployment module to your PYTHONPATH.
Feel free to reopen this issue if there is a bug in the installation instructions. Thanks!
Hey I am running the api on Windows .... I got the same error ... What is the command for windows the add deployment module to PYTHONPATH
Seeing the same problem right now on Ubuntu even after doing the export as per the instruction.
Here's my trace:
File "train.py", line 51, in
For ubuntu @metaranha
- If models is located at /home/tensorflow/models/
- Edit ~/.bashrc and puts
export PYTHONPATH="${PYTHONPATH}:/home/tensorflow/models:/home/tensorflow/models/slim/"
For windows, @jayshah19949596
- Goto
My Computer > Properties > Advanced System Settings > Environment Variables > New - If models is located at
c:\tensorflow - Variable name: Type
PYTHONPATH - Variable value: Fill-in your
c:\tensorflow\modelsandc:\tensorflow\models\slimdirectory
@ninetu Right, I've exported the correct directory, but I'm still hitting the same snag.
On Mon, Sep 18, 2017 at 9:12 AM, ninetu [email protected] wrote:
For ubuntu @metaranha https://github.com/metaranha
- If models https://github.com/tensorflow/models is located at /home/tensorflow/models/
- Edit ~/.bashrc and puts export PYTHONPATH="${PYTHONPATH}:/home/tensorflow/models:/home/ tensorflow/models/slim/"
For windows, @jayshah19949596 https://github.com/jayshah19949596
- Goto My Computer > Properties > Advanced System Settings > Environment Variables > New
- If models https://github.com/tensorflow/models is located at c:\tensorflow
- Variable name: Type PYTHONPATH
- Variable value: Fill-in your c:\tensorflow\models and c:\tensorflow\models\slim directory
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1992#issuecomment-330214819, or mute the thread https://github.com/notifications/unsubscribe-auth/AEe4RL9-KyYy3Q0DtknX2_4zrl6zV0ixks5sjmw1gaJpZM4Od2ZU .
Make sure you puts both models and models/slim ?
On Mon, Sep 18, 2017 at 8:25 PM, emilymaxima [email protected] wrote:
@ninetu https://github.com/ninetu Right, I do have the correct directory exported, but I'm still hitting the same snag.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1992#issuecomment-330219159, or mute the thread https://github.com/notifications/unsubscribe-auth/AVuGRzytBQ2T8DVU2arzmPFilfi3lGmmks5sjm9BgaJpZM4Od2ZU .
Yes, both are exported and I'm still seeing the same "no module named deployment" message.
On Mon, Sep 18, 2017 at 9:30 AM, ninetu [email protected] wrote:
Make sure you puts both models and models/slim ?
On Mon, Sep 18, 2017 at 8:25 PM, emilymaxima [email protected] wrote:
@ninetu https://github.com/ninetu Right, I do have the correct directory exported, but I'm still hitting the same snag.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/tensorflow/models/issues/1992#issuecomment-330219159 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AVuGRzytBQ2T8DVU2arzmPFilfi3lGmmks5sjm9BgaJpZM4Od2ZU> .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1992#issuecomment-330220755, or mute the thread https://github.com/notifications/unsubscribe-auth/AEe4RBJkUbYZ-nqzrn56t9R45JcU-8CTks5sjnBlgaJpZM4Od2ZU .
Have you put it in as c:\tensorflow\models:c:\tensorflow\models\slim in the variable value as if you try to do 2 separate PYTHONPATH one replaces the other I was having the same problem till I tried this and then opened a new cmd window. This worked for me.
I'm building on Ubuntu, but I actually did find a solution to the problem. It's embarrassing, but c'est la vie.
On Ubuntu, you have to 'su' to root and THEN set the path. The path doesn't get applied globally, but you need root permissions to run the script, so the path has to be set for a root-level account before doing all of this. Before, I had been trying to set the path as an unprivileged user, and then escalate, but noticed the path wasn't set.
Did all that, and problem solved!
On Thu, Sep 21, 2017 at 2:50 AM, zshobbs [email protected] wrote:
Have you put it in as c:\tensorflow\models:c:\tensorflow\models\slim in the variable value as if you try to do 2 separate PYTHONPATH one replaces the other i was having the same problem till I tried this and then opened a new cmd window.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1992#issuecomment-331067926, or mute the thread https://github.com/notifications/unsubscribe-auth/AEe4RENGmd_G04oEkc2HE_mfi_ubNRbqks5skgc6gaJpZM4Od2ZU .
For linux users:
protoc object_detection/protos/*.proto --python_out=.
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
Solved my issue
I had the same problem.
make sure you export the right path.
namely
you can check with echo $PYTHONPATH in linux and echo %PYTHONPATH% in windows if it's set alright. try cd-ing into those directories with absolute paths.
there is no need to run anything as root, unless you do systemwide installs with pip or somesuch. you can put export $PYTHONPATH:/absolute/path/to/models/research:/absolute/path/to/models/research/slim at the end of ~/.bashrc and you won't need to type it every time.
from slim.deployment import model_deploy
For windows 7,
- Go to
My Computer > Properties > Advanced System Settings > Environment Variables > New (The first button) - Add
Variable name: PYTHONPATH
Variable value: c:\tensorflow\models;c:\tensorflow\models\slim
Remember, using semicolon between 2 paths.
@FalcoGer , I am running this whole thing on mac. I tried adding as you mentioned in my bash_profile file but still getting "ImportError: No module named deployment" error.
this is how my .bash_profile looks after i add the line as you mentioned.

This is the error i get

If useful for anyone, for pycharm users, simply set research/slim as Sources Root by right clicking the folder and find Mark Directory As can solve the problem.
This work for me in windows:
- Copy relevant deployment files from the \models\slim directory
- paste it to Python\Lib\site-packages directory
then run again.It will work!
As of now, the slim folder has been moved to models/research. So if [models][1] is in the /home directory, do the following to resolve the issue:
1- Open the ~/.bashrc and add the following line to the end of the file:
export PYTHONPATH="$PYTHONPATH:/home/models:/home/models/research/slim/"
3- Close the file and do source ~/.bashrc
edit ./bash_profile in Mac os
Following @CHAMOD recommendation,copy and paste deployment and nets folder. This works for me as well.
Hi I have add the directories o my python path but am still facing the same problem