EdjeElectronics / TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

How to train a TensorFlow Object Detection Classifier for multiple object detection on Windows
Apache License 2.0
2.92k stars 1.3k forks source link

ImportError: cannot import name 'input_reader_pb2' #499

Closed Kiwigamer closed 4 years ago

Kiwigamer commented 4 years ago

I get this error before the train.py process:

D:\tenserflow1\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config 2020-06-17 14:31:58.731602: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll Traceback (most recent call last): File "train.py", line 51, in <module> from object_detection.builders import dataset_builder File "C:\Users\Nutzer\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection\builders\dataset_builder.py", line 27, in <module> from object_detection.data_decoders import tf_example_decoder File "C:\Users\Nutzer\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 24, in <module> from object_detection.protos import input_reader_pb2 ImportError: cannot import name 'input_reader_pb2'

I followed the tutorial but without anaconda and without virtuelinv.

Tylersuard commented 4 years ago

This is probably because you need to add input_reader to the protoc command.

Try this: protoc --python_out=. .\object_detection\protos\input_reader.proto