Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't find field google.protobuf.EnumDescriptorProto.EnumReservedRange.start #14689

Closed
Zumbalamambo opened this issue Nov 18, 2017 · 22 comments

Comments

@Zumbalamambo
Copy link

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"

@andyjslee
Copy link

I'm having the same problem.

@carlthome
Copy link
Contributor

carlthome commented Nov 23, 2017

Maybe you've tried tf-nightly or something? Anyway, try reinstalling the protobuf version that TensorFlow 1.4 wants by running:

pip uninstall protobuf
pip install tensorflow
python -c "import tensorflow"

@TarrySingh
Copy link

No, your answer is incorrect. Tensorflow 1.4 uninstalls protobuf and reinstalls it so I think we need to dig deeper into this.

@carlthome
Copy link
Contributor

carlthome commented Nov 23, 2017

Do you have multiple installs of protobuf in the same Python environment?

@TarrySingh
Copy link

On my mac it all works like a charm including eager execution with nightly build update. It's just on my Ubuntu GPU box , its dying :/

I'll see if downgrading to 3.4.0 gives some positive results.

@TarrySingh
Copy link

TarrySingh commented Nov 23, 2017

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.

deeplearn@Ubuntu-1604-xenial-64-minimal:~$ pip install protobuf==3.4.0
Requirement already satisfied: protobuf==3.4.0 in ./anaconda3/lib/python3.6/site-packages
Requirement already satisfied: setuptools in ./anaconda3/lib/python3.6/site-packages (from protobuf==3.4.0)
Requirement already satisfied: six>=1.9 in ./anaconda3/lib/python3.6/site-packages (from protobuf==3.4.0)
deeplearn@Ubuntu-1604-xenial-64-minimal:~$ pip install protobuf==3.5.0.post1
Collecting protobuf==3.5.0.post1
  Using cached protobuf-3.5.0.post1-py2.py3-none-any.whl
Requirement already satisfied: six>=1.9 in ./anaconda3/lib/python3.6/site-packages (from protobuf==3.5.0.post1)
Requirement already satisfied: setuptools in ./anaconda3/lib/python3.6/site-packages (from protobuf==3.5.0.post1)
Installing collected packages: protobuf
  Found existing installation: protobuf 3.4.0
    Uninstalling protobuf-3.4.0:
      Successfully uninstalled protobuf-3.4.0
Successfully installed protobuf-3.5.0.post1
deeplearn@Ubuntu-1604-xenial-64-minimal:~$ 

as a result, this baby's working :)

screen shot 2017-11-23 at 23 42 32

@zeyu-h
Copy link

zeyu-h commented Nov 23, 2017

I run into the same problem, and your solution works for me.

@TarrySingh
Copy link

Glad to hear 😃

@wangzheqie
Copy link

check if your protobuf are installed deplicately like:

  • sudo apt-get install python3-protobuf or python-protobuf
  • pip install protobuf or pip3 install protobuf

If both installed, uninstall one of them

@Zumbalamambo
Copy link
Author

I tried all... i tried reinstalling protobuf, tensorflow but still the same issue :(

@evindj
Copy link

evindj commented Nov 24, 2017

Thanks @TarrySingh Your solution worked for me

@pyxploiter
Copy link

Thank you @TarrySingh. Your solution works like charm ^_^

@gokceneraslan
Copy link
Contributor

In my case protobuf from conda-forge was the reason for the error. I removed it via conda remove protobuf and reinstalled protobuf via pip.

@TarrySingh
Copy link

Awesome to hear that 👌

@zumbalambo — you need to share your error.

@RakshakTalwar
Copy link

@TarrySingh your solution worked for me as well!

@hoangcuong2011
Copy link

Thanks @TarrySingh, pip install protobuf==3.4.0 solved the problem!

@danielfleischer
Copy link

@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.

@tatatodd tatatodd closed this as completed Dec 1, 2017
@lgrcyanny
Copy link

lgrcyanny commented Dec 7, 2017

came with the same issue, I solved it with these commands:

conda remove protobuf
pip install tensorflow=1.4.0
pip install protobuf==3.4.0
pip install protobuf==3.5.0.post1
python -c "import tensorflow"

thanks @gokceneraslan and @TarrySingh

@Kornel
Copy link

Kornel commented Dec 15, 2017

In my case tf 1.4.1 works only with protobuf 3.4.0:

python -c "import tensorflow as tf; print(tf.__version__); import google.protobuf as pb; print(pb.__version__)"
1.4.1
3.4.0

Upgrading protobuf to 3.5.x results in KeyError: "Couldn't find field google.protobuf.EnumDescriptorProto.EnumReservedRange.start"

@angshine
Copy link

I find this solution really helpful:

  1. uninstall all the protobuf on your machine (both from anaconda and pip)
    pip uninstall protobuf
    conda remove protobuf
    you may try them twice to make sure all the version of protobuf have been removed
  2. install protobuf using pip:
    pip install protobuf==3.5.0.post1

@yoyoalphax
Copy link

1、remove all the protobuf, by pip list, conda list and so on
2、install a new one

@Alexuan
Copy link

Alexuan commented Jan 28, 2018

@TarrySingh thanks 大傻猫,你真棒👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests