{"id":293,"hash":"005523822a9fe5fa7d146cff8d972dc114046656d81f1ff298799867895374a6","pattern":"How to solve &quot;AttributeError: module &#39;google.protobuf.descriptor&#39; has no attribute &#39;_internal_create_key&quot;?","full_message":"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)\nThe complete error log:\n\nAttributeError                            Traceback (most recent call last)\n<ipython-input-7-7035655b948a> in <module>\n      1 from object_detection.utils import ops as utils_ops\n----> 2 from object_detection.utils import label_map_util\n      3 from object_detection.utils import visualization_utils as vis_util\n\n~\\AppData\\Roaming\\Python\\Python37\\site-packages\\object_detection\\utils\\label_map_util.py in <module>\n     25 import tensorflow as tf\n     26 from google.protobuf import text_format\n---> 27 from object_detection.protos import string_int_label_map_pb2\n     28 \n     29 \n\n~\\AppData\\Roaming\\Python\\Python37\\site-packages\\object_detection\\protos\\string_int_label_map_pb2.py in <module>\n     19   syntax='proto2',\n     20   serialized_options=None,\n---> 21   create_key=_descriptor._internal_create_key,\n     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'\n     23 )\n\nAttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'","ecosystem":"pypi","package_name":"tensorflow","package_version":null,"solution":"The protoc version I got through pip show protobuf and protoc --version were different. The version in pip was a bit outdated.\n\nAfter I upgraded the pip version with\n\npip install --upgrade protobuf\n\nthe problem was solved.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/61922334/how-to-solve-attributeerror-module-google-protobuf-descriptor-has-no-attribu","votes":105,"created_at":"2026-04-19T04:41:46.113240+00:00","updated_at":"2026-04-19T04:51:57.735142+00:00"}