I encountered it while executing from object_detection.utils import label_map_util
in jupyter notebook. It is actually the tensorflow object detection tutorial notebook(it comes with the tensorflow object detection api)
The complete error log:
AttributeError Traceback (most recent call last)
<ipython-input-7-7035655b948a> in <module>
1 from object_detection.utils import ops as utils_ops
----> 2 from object_detection.utils import label_map_util
3 from object_detection.utils import visualization_utils as vis_util
~AppDataRoamingPythonPython37site-packagesobject_detectionutilslabel_map_util.py in <module>
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
~AppDataRoamingPythonPython37site-packagesobject_detectionprotosstring_int_label_map_pb2.py in <module>
19 syntax='proto2',
20 serialized_options=None,
---> 21 create_key=_descriptor._internal_create_key,
22 serialized_pb=b'
2object_detection/protos/string_int_label_map.protox12x17object_detection.protos"xc0x01
x15StringIntLabelMapItemx12x0c
x04namex18x01 x01(x12
x02idx18x02 x01(x05x12x14
x0cx64isplay_namex18x03 x01(x12M
keypointsx18x04 x03(x0bx32:.object_detection.protos.StringIntLabelMapItem.KeypointMapx1a(
x0bKeypointMapx12
x02idx18x01 x01(x05x12
x05labelx18x02 x01("Q
x11StringIntLabelMapx12<
x04itemx18x01 x03(x0bx32..object_detection.protos.StringIntLabelMapItem'
23 )
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…