天天看点

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