tensorflow / models

Models and examples built with TensorFlow
Other
77k stars 45.79k forks source link

ImportError: cannot import name 'string_int_label_map_pb2' #8205

Open ayushmankumar7 opened 4 years ago

ayushmankumar7 commented 4 years ago

System information

Please provide the entire URL of the model you are using?

Describe the current behavior

Describe the expected behavior

Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. -->

Other info / logs Traceback (most recent call last): File "model_main.py", line 26, in from object_detection import model_lib File "/home/ayushman/Documents/Github/models/research/object_detection/model_lib.py", line 27, in from object_detection import eval_util File "/home/ayushman/Documents/Github/models/research/object_detection/eval_util.py", line 33, in from object_detection.metrics import coco_evaluation File "/home/ayushman/Documents/Github/models/research/object_detection/metrics/coco_evaluation.py", line 27, in from object_detection.utils import object_detection_evaluation File "/home/ayushman/Documents/Github/models/research/object_detection/utils/object_detection_evaluation.py", line 46, in from object_detection.utils import label_map_util File "/home/ayushman/Documents/Github/models/research/object_detection/utils/label_map_util.py", line 27, in from object_detection.protos import string_int_label_map_pb2 ImportError: cannot import name 'string_int_label_map_pb2'

arliemoore commented 4 years ago

Just hit this today as well

sglvladi commented 4 years ago

TensorFlow 2.x does not support object detection, yet. I would suggest using TensorFlow 1.14 instead.

arliemoore commented 4 years ago

Hey so for anyone who runs into this issue, I believe my co-worker found a solution. After cloning the repo you can run the following commands and it seems to fix this error.

cd models/research protoc object_detection/protos/*.proto --python_out=.