ImportError: cannot import name 'input_reader_pb2'

南笙酒味 提交于 2019-12-08 01:22:26

问题


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


回答1:


Seems that you didnt compile protobuf. For solving it:

  1. Download the latest protoc exe here: https://github.com/google/protobuf/releases (in your case should be win32)
  2. Rename that folder to "protoc"
  3. Put that folder inside models/research
  4. in models/research via console, launch:

    protoc/bin/protoc object_detection/protos/*.proto --python_out=.
    

I dont know exactly if that command will work on windows, but you have to be sure that you are using the protoc compiler that you downloaded (v.3.6) instead of the protoc in your enviroment.



来源:https://stackoverflow.com/questions/51603324/importerror-cannot-import-name-input-reader-pb2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!