models icon indicating copy to clipboard operation
models copied to clipboard

cannot import name string_int_label_map_pb2

Open xunkaixin opened this issue 9 years ago • 4 comments

ImportError Traceback (most recent call last) in () ----> 1 from utils import label_map_util 2 3 from utils import visualization_utils as vis_util

/home/qkj/project/tools_project/tensorflow/models/object_detection/utils/label_map_util.py in () 20 import tensorflow as tf 21 from google.protobuf import text_format ---> 22 from object_detection.protos import string_int_label_map_pb2 23 24

ImportError: cannot import name string_int_label_map_pb2

xunkaixin avatar Jun 15 '17 09:06 xunkaixin

Hey, I met the same problem. However, I searched for information about ".proto" files -- they should be complied at first. For example, you should compile the file "string_int_label_map.proto" to get "string_int_label_map_pb2.py"

codeBeforeBC avatar Jun 15 '17 14:06 codeBeforeBC

Did you follow the installation steps? In particular, you're required to generate our protobuf library.

derekjchow avatar Jun 15 '17 20:06 derekjchow

I apologize but I am having a hard time understanding what the problem is, where the problem is, and what version it affects. Please resubmit and pay attention to the issue template (https://github.com/tensorflow/tensorflow/issues/new) . Please provide all the information it asks. Thank you.

aselle avatar Jun 15 '17 23:06 aselle

Hey, I met the same problem. However, I searched for information about ".proto" files -- they should be complied at first. For example, you should compile the file "string_int_label_map.proto" to get "string_int_label_map_pb2.py"

how to compile it, can you plz tell me the procedure?

PreethmKumar avatar Mar 18 '19 07:03 PreethmKumar