TensorFlow KeyError: "Couldn't find field google.protobuf.DescriptorProto.ExtensionRange.options"

来源:互联网 发布:网络摄像头修改密码 编辑:程序博客网 时间:2024/06/11 19:32

目录

    • 问题描述
    • 解决办法
    • 参考资料


问题描述

  • python 版本3.5
  • macbook在用pip安装tensorflow后由于某些原因用pip又卸载了,然后再次pip install tensorflow,tensorflow安装成功

此时import tensorflow时报错:
KeyError: “Couldn’t find field google.protobuf.DescriptorProto.ExtensionRange.options”
如下图:
这里写图片描述


解决办法

pip uninstall protobufpip install protobuf==3.3.0

两行代码重装protobuf,问题解决
推测是在卸载tensorflow时使得protobuf组件缺失,导致报错


参考资料

https://github.com/tensorflow/tensorflow/issues/12326

原创粉丝点击