tensorflow: Couldn't find field google.protobuf.EnumDescriptorProto.EnumReservedRange.start
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 <module> import tensorflow as tf File “/Users/anaconda/envs/cnn/lib/python3.6/site-packages/tensorflow/init.py”, line 24, in <module> from tensorflow.python import * File “/Users/anaconda/envs/cnn/lib/python3.6/site-packages/tensorflow/python/init.py”, line 52, in <module> 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 <module> from google.protobuf import descriptor_pb2 File “/Users/anaconda/envs/cnn/lib/python3.6/site-packages/google/protobuf/descriptor_pb2.py”, line 735, in <module> 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”
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (3 by maintainers)
I find this solution really helpful:
pip uninstall protobuf
conda remove protobuf
you may try them twice to make sure all the version of protobuf have been removedpip install protobuf==3.5.0.post1
OK, here is the solution – funny but worked for me 👯♂️
I uninstalled protobuf 3.5.0.post1, which comes with TF 1.4.1 distro, installed 3.4.0 release and then installed 3.5.0.post1.
as a result, this baby’s working 😃
Maybe you’ve tried tf-nightly or something? Anyway, try reinstalling the protobuf version that TensorFlow 1.4 wants by running:
came with the same issue, I solved it with these commands:
thanks @gokceneraslan and @TarrySingh
Thanks @TarrySingh, pip install protobuf==3.4.0 solved the problem!
In my case tf 1.4.1 works only with protobuf 3.4.0:
Upgrading protobuf to 3.5.x results in
KeyError: "Couldn't find field google.protobuf.EnumDescriptorProto.EnumReservedRange.start"
check if your
protobuf
are installed deplicately like:or
python-protobufor
pip3 install protobufIf both installed, uninstall one of them
1、remove all the protobuf, by pip list, conda list and so on 2、install a new one
@TarrySingh didn’t immediately help but upgrading all pip packages did:
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
Hope it helps.
I tried all… i tried reinstalling protobuf, tensorflow but still the same issue 😦