Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (..\object_detection\protos\__init__.py) #9

Open
imsunnykr opened this issue May 26, 2020 · 5 comments

Comments

@imsunnykr
Copy link

`---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in
11
12 # Import utilites
---> 13 from utils import label_map_util
14 from utils import visualization_utils as vis_util
15

~\Desktop\Mask Detector\master\research\object_detection\utils\label_map_util.py in
25 import tensorflow as tf
26 from google.protobuf import text_format
---> 27 from object_detection.protos import string_int_label_map_pb2
28
29

ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos' (..\object_detection\protos_init_.py)
`
I have tensorflow version '1.15.0'

@Spidy20
Copy link
Owner

Spidy20 commented May 27, 2020 via email

@imsunnykr
Copy link
Author

Now this error..

`~\Desktop\Mask Detector\master\research\object_detection\protos\string_int_label_map_pb2.py in
19 syntax='proto2',
20 serialized_options=None,
---> 21 create_key=_descriptor._internal_create_key,
22 serialized_pb=b'\n2object_detection/protos/string_int_label_map.proto\x12\x17object_detection.protos"\xc0\x01\n\x15StringIntLabelMapItem\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12M\n\tkeypoints\x18\x04 \x03(\x0b\x32:.object_detection.protos.StringIntLabelMapItem.KeypointMap\x1a(\n\x0bKeypointMap\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05label\x18\x02 \x01(\t"Q\n\x11StringIntLabelMap\x12<\n\x04item\x18\x01 \x03(\x0b\x32..object_detection.protos.StringIntLabelMapItem'
23 )

AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'`

@imsunnykr
Copy link
Author

Can you please share your protoc and protobuf version that you are using.

@Spidy20
Copy link
Owner

Spidy20 commented May 27, 2020 via email

@imsunnykr
Copy link
Author

Thank you for the quick response. The code is working after I upgraded my protobuf.
I have tested on couple of images and number of detection is more than 1. sharing the image for reference.
test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants