Tensorflow Object Detection: ImportError: No module named nets

I am currently trying to install tensorflow object detection application on Windows 7 (employer's requirement) and I cannot follow a few steps from the end.

Basically I get the following error when running the install command: ImportError: No module named nets.

I have read several solutions on this matter:

https://github.com/tensorflow/models/issues/729 https://github.com/tensorflow/models/issues/1842

which looks like this: export PYTHONPATH = "$ PYTHONPATH:" somepath "/ tensorflow / models / slim"

basically means that I have to set the correct path in the PYTHONPATH environment variable.

On Windows I tried this: SET PYTHONPATH = "$ PYTHONPATH: C: tensorflow / models / slim And when that didn't work, I created the PYTHONPATH variable in the system-> environment variables.

I am still getting the error, so I suppose I am still missing something, but due to lack of knowledge, I still cannot figure out what.

Anyone familiar with Windows will be able to point out what's missing?

thank

+3


source to share


3 answers


I figured out a way to make it work. I am not writing this as a definitive answer as it is basically a workaround, and due to misunderstandings on my part, I cannot guarantee that this will work (nor may it be best practice).

Anyway, these are:

As previously suggested by Beta, you need to run setup.py, however running it from the samples folder did not do that for me, I also had to run it from the object discovery folder.



However, there was a problem there, it threw an error saying BUILD already exists (which was correct), so I had to delete the BUILD file from inside the model.

After that it worked, it turns out that the path I set is working fine.

Now, if some experts go over this and explain how and why this workaround worked, that might make it the right solution.

0


source


in the linux: add export export the PYTHONPATH $ = the PYTHONPATH: pwd

: pwd

/ slim to ~ / .bashrc Note: you must leave the single quotation mark



if you are working with windows i think this should like it: PYTHONPATH = $ PYTHONPATH: 'C: / tensorflow / models': 'C: / tensorflow / models' / slim just think you can try. good luck!

+1


source


If you run setup.py, it will install all the relevant modules for object detection. Another option is to download the git directory. cd to a folder and try running the module from there. You may face protubuf problem. Try installing it before running the code. It was difficult to install protobuf on windows. But if you're not using a ".pb" file, you don't need to.

0


source







All Articles