ImportError: cannot import name 'input_reader_pb2'

Ferado Alberto picture Ferado Alberto · Jul 31, 2018 · Viewed 7.3k times · Source

working on win10 64-bit

when i trying to train my model by E:\projectx\model-master\models-master>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config

this error appear

File "train.py", line 49, in from object_detection.builders import dataset_builder File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\dataset_builder.py", line 27, in from object_detection.data_decoders import tf_example_decoder File "C:\Users\DELL\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py", line 27, in from object_detection.protos import input_reader_pb2 ImportError: cannot import name 'input_reader_pb2'

i do run protoc 3.4 protoc object_detection/protos/*.proto --python_out=. but the error still exist i check all thing and it is should be fine and work, it is going me mad!!

please help.... thanks

Answer

Foysal Khandakar Joy picture Foysal Khandakar Joy · Feb 19, 2020

As you already compiled all .proto files in object_detection/protos/ . You should see python files which have '_pb2' like eval_pb2. If you can see these then go to models/research directory and run these code one by one:

python setup.py build
python setup.py install