天天看點

TypeError: __new__() got an unexpected keyword argument 'serialized_options'

使用 tensorflow

報錯:

TypeError: new() got an unexpected keyword argument ‘serialized_options’

解決:

在終端上的 protoc 版本 與pycharm 中用conda 安裝的protobuf版本不一樣。然後在終端上進行proto檔案編譯,在pycharm上運作相關腳本,出現以上錯誤。在pycharm中調整protobuf的版本後錯誤消失。

解除安裝protoc ,重新安裝

pip uninstall protobuf
pip install -U protobuf
           

參考:https://github.com/tensorflow/models/issues/3995#issuecomment-400183986