Python 导入tensorflow时发生EnumDescriptorProto错误
我正在尝试运行以下代码Python 导入tensorflow时发生EnumDescriptorProto错误,python,tensorflow,Python,Tensorflow,我正在尝试运行以下代码 import tensorflow as tf print("Hello TensorFlow version", tf.__Version__) 它正在触发以下错误 用户/anaconda/envs/cnn/bin/python /Users/Downloads/rude carnie/version.py回溯(最近的电话 最后):文件“/Users/Downloads/rude carnie/version.py”,第1行,在 将tensorflow作为tf文件导
import tensorflow as tf
print("Hello TensorFlow version", tf.__Version__)
它正在触发以下错误
用户/anaconda/envs/cnn/bin/python
/Users/Downloads/rude carnie/version.py回溯(最近的电话
最后):文件“/Users/Downloads/rude carnie/version.py”,第1行,在
将tensorflow作为tf文件导入
“/Users/anaconda/envs/cnn/lib/python3.6/site packages/tensorflow/init.py”,
第24行,来自tensorflow.python导入*文件
“/Users/anaconda/envs/cnn/lib/python3.6/site packages/tensorflow/python/init.py”,
第52行,来自tensorflow.core.framework.graph_pb2 import*文件
“/Users/anaconda/envs/cnn/lib/python3.6/site packages/tensorflow/core/framework/graph_pb2.py”,
第10行,来自google.protobuf导入描述符_pb2文件
“/Users/anaconda/envs/cnn/lib/python3.6/site packages/google/protobuf/descriptor_pb2.py”,
第735行,在选项=无,文件=描述符)中,文件
“/Users/anaconda/envs/cnn/lib/python3.6/site packages/google/protobuf/descriptor.py”,
第501行,在新的返回中
_message.default\u pool.FindFieldByName(全名)键错误:“找不到字段
google.protobuf.EnumDescriptorProto.EnumReservedRange.start“
我怎样才能解决这个问题呢?今天我遇到了同样的问题。 卸载机器上的所有protobuf(来自anaconda和pip) 使用pip安装protobuf:
pip install protobuf==3.5.0.post1
资料来源:
今天我遇到了同样的问题。 卸载机器上的所有protobuf(来自anaconda和pip) 使用pip安装protobuf:
pip install protobuf==3.5.0.post1
资料来源:
你的
是什么?导入google.protobuf;google.protobuf.\uuuuuuuuuuuuuu版本
?您尝试安装了哪个版本的TensorFlow?我使用3.5.0版本的protobuf和1.4 v的TensorFlow看起来像是一条巨蟒。也许可以试试pip/virtualenv?你的导入google.protobuf;google.protobuf.\uuuuuuuuuuuuuu版本
?您尝试安装了哪个版本的TensorFlow?我使用3.5.0版本的protobuf和1.4 v的TensorFlow看起来像是一条巨蟒。也许试试pip/virtualenv?