1
votes

Im trying to run the following code

import tensorflow as tf

print("Hello TensorFlow version", tf.__Version__)

It is firing the following error

Users/anaconda/envs/cnn/bin/python /Users/Downloads/rude-carnie/version.py Traceback (most recent call last): File "/Users/Downloads/rude-carnie/version.py", line 1, in import tensorflow as tf File "/Users/anaconda/envs/cnn/lib/python3.6/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/Users/anaconda/envs/cnn/lib/python3.6/site-packages/tensorflow/python/init.py", line 52, in from tensorflow.core.framework.graph_pb2 import * File "/Users/anaconda/envs/cnn/lib/python3.6/site-packages/tensorflow/core/framework/graph_pb2.py", line 10, in from google.protobuf import descriptor_pb2 File "/Users/anaconda/envs/cnn/lib/python3.6/site-packages/google/protobuf/descriptor_pb2.py", line 735, in options=None, file=DESCRIPTOR), File "/Users/anaconda/envs/cnn/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 501, in new return _message.default_pool.FindFieldByName(full_name) KeyError: "Couldn't find field google.protobuf.EnumDescriptorProto.EnumReservedRange.start"

how can I be able to sort this out?

1
What's your import google.protobuf; google.protobuf.__version__? And which version of TensorFlow did you try to install?Allen Lavoie
im using 3.5.0 version of protobuf and 1.4 v of tensorflowuser3600801
Seems like an Anaconda issue. Maybe try pip/virtualenv?Allen Lavoie

1 Answers

0
votes

Today I came across same problem. Uninstall all the protobuf on your machine (both from anaconda and pip)

pip uninstall protobuf
conda remove protobuf

install protobuf using pip:

pip install protobuf==3.5.0.post1

Source : https://github.com/tensorflow/tensorflow/issues/14689