LimelightVision / notebooks

Other
1 stars 0 forks source link

Training notebook not making label files #1

Open EmraldXd opened 1 week ago

EmraldXd commented 1 week ago

I've been getting this error when trying to develop a TensorFlow model:

TypeError: Descriptors cannot be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

    I've tried the limelight help page, google gemini suggestions, and restarting my session multiple times. This is recent because it worked for one file, but now fails when I use the file that succeeded before.

Gwestmech commented 4 days ago

same


TypeError Traceback (most recent call last) in <cell line: 38>() 36 37 ---> 38 num_classes = get_num_classes(label_map_pbtxt_fname) 39 classes = get_classes(label_map_pbtxt_fname) 40

3 frames in get_num_classes(pbtxt_fname) 13 14 """ ---> 15 from object_detection.utils import label_map_util 16 label_map = label_map_util.load_labelmap(pbtxt_fname) 17 categories = label_map_util.convert_label_map_to_categories(

/usr/local/lib/python3.10/dist-packages/object_detection/utils/label_map_util.py in 27 import tensorflow.compat.v1 as tf 28 from google.protobuf import text_format ---> 29 from object_detection.protos import string_int_label_map_pb2 30 31 _LABEL_OFFSET = 1

/usr/local/lib/python3.10/dist-packages/object_detection/protos/string_int_label_map_pb2.py in 31 create_key=_descriptor._internal_create_key, 32 values=[ ---> 33 _descriptor.EnumValueDescriptor( 34 name='UNSPECIFIED', index=0, number=0, 35 serialized_options=None,

/usr/local/lib/python3.10/dist-packages/google/protobuf/descriptor.py in new(cls, name, index, number, type, options, serialized_options, create_key) 918 type=None, # pylint: disable=redefined-builtin 919 options=None, serialized_options=None, create_key=None): --> 920 _message.Message._CheckCalledFromGeneratedFile() 921 # There is no way we can build a complete EnumValueDescriptor with the 922 # given parameters (the name of the Enum is not known, for example).

TypeError: Descriptors cannot be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates