some errors with tensorflow 'object_detection' and preprocessor_pb2
Problem solved
Problem: ERROR: No module named 'object_detection'
Problem: ERROR: No module named 'object_detection'
- go to your tensorflow folder (..\Python\Python36\Lib\site-packages\tensorflow\)
- if there is not a folder call models or models-master download it from https://github.com/tensorflow/models and put the folder in tensorflow folder
- open cmd
- cd ..\Python\Python36\Lib\site-packages\tensorflow\models-master (or models)
- python setup.py install
- DONE
Problem: ERROR: ImportError: cannot import name preprocessor_pb2
- download protoc-3.5.0-win32.zip from https://github.com/google/protobuf/releases
- unzip and copy the protoc.exe in bin folder to your tensorflow\models\research folder (in my case is ..\Python\Python36\Lib\site-packages\tensorflow\models-master\research\)
- open cmd
- cd ..\Python\Python36\Lib\site-packages\tensorflow\models\research\ (in my case is ..\Python\Python36\Lib\site-packages\tensorflow\models-master\research\)
- in normal case you can just run "protoc object_detection\protos\*.proto --python_out=." However, in windows10, it cannot recognize wildcase'*'. You can use specific name to run it one by one. Or use for loop to do it. just run "for %i in (object_detection\protos\*.proto) DO protoc %i --python_out=."
- right click on "This PC" -> properties ->Advanced system settings -> Environment variables -> system variable -> New...
- variable name: "PYTHONPATH", variable value: "...\tensorflow\models-master\research\; ...\tensorflow\models-master\research\slim"
- DONE
note: don't use "export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim" or "set PYTHONPATH=$PYTHONPATH:pwd:pwd/slim" in cmd, it is not working!
Comments
Post a Comment