Tensorflow Object Detection API for Windows - Error "ModuleNotFoundError: No module named utils"

I am trying to get the TensorFlow Object Detection API

https://github.com/tensorflow/models/tree/master/research/object_detection

runs on Windows following installation instructions

https://github.com/tensorflow/models/tree/master/research/object_detection

It seems to be for Linux / Mac. I can get this to work if I put the script in the directory into which I cloned the above repo. If I put the script in any other directory, I get this error:

ModuleNotFoundError: No module named 'utils'

I suspect that the reason does not match the Windows equivalent specified in the installation instructions above:

# From tensorflow/models/research/
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim

I use Windows 10, Python 3.6, and TensorFlow 1.4.0, if that matters. Of course, I searched for this problem and found various links, for example:

https://github.com/tensorflow/models/issues/1747

. ?

, :


EDIT: , RecencyEffect

1) TensorFlow pip3

2) :

pip3 install pillow
pip3 install lxml
pip3 install jupyter
pip3 install matplotlib

3) "" TensorFlow "",

C:\Users\cdahms\Documents\models

4) Google Protobuf https://github.com/google/protobuf Windows v3.4.0 release "protoc-3.4.0-win32.zip" ( 3.5.1 , 3.4.0 vid https://www.youtube.com/watch?v=COlbP62-B-U&list=PLQVvvaa0QuDcNK5GeCQnxYnSSaar2tpku&index=1 protobuf )

5) Protobuf Program Files,

"C:\Program Files\protoc-3.4.0-win32"

6) CD \research,

cd C:\Users\cdahms\Documents\models\research

7) protobuf,

"C:\Program Files\protoc-3.4.0-win32\bin\protoc.exe" object_detection/protos/*.proto --python_out=.

:

C:\Users\cdahms\Documents\models\research\object_detection\protos

, .py ( .proto)

8) cd object_detection, :

cd C:\Users\cdahms\Documents\models\research\object_detection

, object_detection_tutorial.ipynb Jupyter Notebook

jupyter notebook

9) Jupyter Notebook "object_detection_tutorial.ipynb" → Cell → Run all,

10) Jupyter Notebook "" → " " → "Python" .py ,

C:\Users\cdahms\Documents\models\research\object_detection\object_detection_tutorial.py

script Python (, PyCharm) .


RecencyEffect , , object_detection_tutorial.py script

11) script , , , :

ModuleNotFoundError: No module named 'utils'

Python, utils, :

from utils import label_map_util
from utils import visualization_utils as vis_util

.,.

12) → → ., → PYTHONPATH :

enter image description here

13) PATH % PYTHONPATH% :

enter image description here

14) , , .

15) "set", , PYTHONPATH , PYTHONPATH PATH .

16) "object_detection_tutorial.py"

+4
2

, utils , object_detection PYTHONPATH, object_detection/utils.

, .

0

cd /Object _Detection

cd..

  • export PATH = ~/anaconda3/bin: $PATH

  1. git clone https://github.com/tensorflow/models.git

3.export PYTHONPATH = $PYTHONPATH: pwd: pwd/slim

4.protoc object_detection/protos/string_int_label_map.proto --python_out =.

CD OBJECT_DETECTION

  1. protoc protos/string_int_label_map.proto --python_out =.

6.jupyter

0

Source: https://habr.com/ru/post/1686654/


All Articles