成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
目录
TypeError: __init__() got an unexpected keyword argument 'serialized_options'
- File "object_detection/builders/model_builder_test.py", line 24, in -operator"><module-operator">>
- from object_detection.builders import model_builder
- File "F:\File_Python\Python_example\models-master-subst">\research\object_detection\builders\model_builder.py", line 20, in -operator"><module-operator">>
- from object_detection.builders import anchor_generator_builder
- File "F:\File_Python\Python_example\models-master-subst">\research\object_detection\builders\anchor_generator_builder.py", line 21, in -operator"><module-operator">>
- from object_detection.protos import anchor_generator_pb2
- File "F:\File_Python\Python_example\models-master-subst">\research\object_detection\protos\anchor_generator_pb2.py", line 15, in -operator"><module-operator">>
- from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
- File "F:\File_Python\Python_example\models-master-subst">\research\object_detection\protos\grid_anchor_generator_pb2.py", line 22, in -operator"><module-operator">>
- serialized_pb-operator">=_b('\n3object_detection-operator">/protos-operator">/grid_anchor_generator.proto\x12\x17object_detection.protos\"\xcd\x01-subst">\n\x13GridAnchorGenerator\x12\x13-subst">\n\x06height\x18\x01 \x01(\x05:\x03\x32\x35\x36\x12\x12-subst">\n\x05width\x18\x02 \x01(\x05:\x03\x32\x35\x36\x12\x19-subst">\n-subst">\rheight_stride\x18\x03 \x01(\x05:\x02\x31\x36\x12\x18-subst">\n\x0cwidth_stride\x18\x04 \x01(\x05:\x02\x31\x36\x12\x18-subst">\n-subst">\rheight_offset\x18\x05 \x01(\x05:\x01\x30\x12\x17-subst">\n\x0cwidth_offset\x18\x06 \x01(\x05:\x01\x30\x12\x0e-subst">\n\x06scales\x18\x07 \x03(\x02\x12\x15-subst">\n-subst">\raspect_ratios\x18\x08 \x03(\x02')
- TypeError: __init__() got an unexpected keyword argument 'serialized_options'
类型错误:__init__()得到意外的关键字参数“serialized_options”
出现该问题,很有可能是,终端上的 protoc 版本 与python库内的protobuf版本不一样。
安装对应版本的库即可!比如我的执行下列命令
pip install -U protobuf
大功告成!完美解决!
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
加入交流群
请使用微信扫一扫!