日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'

發布時間:2025/3/21 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options' 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

成功解決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 <module>from object_detection.builders import model_builderFile "F:\File_Python\Python_example\models-master\research\object_detection\builders\model_builder.py", line 20, in <module>from object_detection.builders import anchor_generator_builderFile "F:\File_Python\Python_example\models-master\research\object_detection\builders\anchor_generator_builder.py", line 21, in <module>from object_detection.protos import anchor_generator_pb2File "F:\File_Python\Python_example\models-master\research\object_detection\protos\anchor_generator_pb2.py", line 15, in <module>from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2File "F:\File_Python\Python_example\models-master\research\object_detection\protos\grid_anchor_generator_pb2.py", line 22, in <module>serialized_pb=_b('\n3object_detection/protos/grid_anchor_generator.proto\x12\x17object_detection.protos\"\xcd\x01\n\x13GridAnchorGenerator\x12\x13\n\x06height\x18\x01 \x01(\x05:\x03\x32\x35\x36\x12\x12\n\x05width\x18\x02 \x01(\x05:\x03\x32\x35\x36\x12\x19\n\rheight_stride\x18\x03 \x01(\x05:\x02\x31\x36\x12\x18\n\x0cwidth_stride\x18\x04 \x01(\x05:\x02\x31\x36\x12\x18\n\rheight_offset\x18\x05 \x01(\x05:\x01\x30\x12\x17\n\x0cwidth_offset\x18\x06 \x01(\x05:\x01\x30\x12\x0e\n\x06scales\x18\x07 \x03(\x02\x12\x15\n\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

?

大功告成!完美解決!

?

?

?

?

?

《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀

總結

以上是生活随笔為你收集整理的成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。