Models: Error in Protobuf libraries compilation during installing Object Detection API

Created on 16 Jun 2017  Â·  20Comments  Â·  Source: tensorflow/models

_object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optional", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number._

I got this error while running the command protoc object_detection/protos/*.proto --python_out=.

I am using ubuntu 14.04, and tensorflow 1.2.0 installed in python3.6 env

Most helpful comment

Hi everyone,

Thanks for trying this out! So the problem here is that our code requires a newer version of the protoc compiler than is released by default by the older ubuntu versions (e.g. 14.04). I recommend upgrading your protoc compiler to the latest version and trying again.

You can download a new version of the protoc binary here:
https://github.com/google/protobuf/releases

All 20 comments

I have a related question. Where is the tensorflow/models folder? Do you clone the gtihub repo or do you go to the installation folder after installation with pip?

me too,then i git clone https://github.com/tensorflow/models.git
cp the models folder to tensorflow folder
done

I have the same problem , i am using ubuntu 14.04 ,tensorflow 1.2.0, python 2.7 and anaconda2

Hi, I have the same issue.
OS: CentOS
Python 3.4.3
tensorflow-gpu (from pip)

I have the same issue. I installed tensorflow 1.2 from source on Ubuntu 14.04, python 2.7

Hi everyone,

Thanks for trying this out! So the problem here is that our code requires a newer version of the protoc compiler than is released by default by the older ubuntu versions (e.g. 14.04). I recommend upgrading your protoc compiler to the latest version and trying again.

You can download a new version of the protoc binary here:
https://github.com/google/protobuf/releases

Closing since it looks like this is solved. If that's not the case please let us know.

@jch1 could you also add a note to the object_detection README to include your protoc tip above?

Hi @jch1
Many thanks , this worked with me but when trying python object_detection/builders/model_builder_test.py
I get error when the code imports tensorflow
full error:

Traceback (most recent call last):
  File "object_detection/builders/model_builder_test.py", line 18, in <module>
    import tensorflow as tf
  File "/home/vulture/anaconda/conda/envs/mypython3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/vulture/anaconda/conda/envs/mypython3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/home/vulture/anaconda/conda/envs/mypython3/lib/python3.6/site-packages/tensorflow/core/framework/graph_pb2.py", line 9, in <module>
    from google.protobuf import symbol_database as _symbol_database
ImportError: cannot import name 'symbol_database'

Hi @MoAbd, unfortunately that's outside of the scope of the models repository. It looks to me like you may be getting some odd interactions between Anaconda and TensorFlow. I would try asking on StackOverflow.

Try upgrading protobuf by using 'pip nstall protobuf--upgrade'

I've same problem.

$ protoc object_detection/protos/*.proto --python_out=.
object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optional", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number.

OS: Ubuntu 14.04.x
Tensorflow: 1.2.1
python 2.7

When I upgrade protobuf to the latest version 3.4.0, I still have the same problem.

protoc object_detection/protos/*.proto --python_out=.
object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optional", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number.

I am having the same problem as well!

I was able to get it working today using protoc version 3.3.0 as shown here: https://github.com/tensorflow/models/issues/1834

    mkdir -p ~/installs/protoc_3.3.0
    cd ~/installs/protoc_3.3.0
    wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
    chmod 775 protoc-3.3.0-linux-x86_64.zip
    unzip protoc-3.3.0-linux-x86_64.zip

Then:

    cd ~/git/models/
    ~/installs/protoc_3.3.0/bin/protoc object_detection/protos/*.proto --python_out=.
    python setup.py install --prefix=~

Can i also install
mkdir -p ~/installs/protoc_3.3.0
cd ~/installs/protoc_3.3.0
wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
chmod 775 protoc-3.3.0-linux-x86_64.zip
unzip protoc-3.3.0-linux-x86_64.zip
for windows?

@alisidaniel No these are bash commands.

@alisidaniel What @sangeet259 said is true. You can't use those commands on Windows. The commands won't work and you will download the wrong installation anyway. You want to:

  1. Download the correct file: https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-win32.zip
  2. Unzip it
  3. Run the executable from the command line similar to my 2nd box above to compile the protobuf files for Python.
  4. Run setup.py install to install the new Python protobuf files.

Please how can i use tensorflow to do recognition of staffs in my Office
with my System so as to give them access Rights to some doors using
rapsbery pi
Also how can i set the tensorflow up to work on My Pycharm it always gives
me error from utils label_map_util and visualization_utils how can i slove
those errors

On Nov 6, 2017 7:00 PM, "Daniel Gleason" notifications@github.com wrote:

@alisidaniel https://github.com/alisidaniel What @sangeet259
https://github.com/sangeet259 said is true. You can't use those
commands on Windows. The commands won't work and you will download the
wrong installation anyway. You want to:

  1. Download the correct file: https://github.com/google/prot
    obuf/releases/download/v3.3.0/protoc-3.3.0-win32.zip
    https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-win32.zip
  2. Unzip it
  3. Run the executable from the command line similar to my 2nd box
    above to compile the protobuf files for Python.
  4. Run setup.py install to install the new Python protobuf files.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/models/issues/1570#issuecomment-342232475,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATP8TLsWqiOKWpRVJfsEdOCLmM2VQ55Jks5sz0lKgaJpZM4N8Bkd
.

Please how can i use tensorflow to do recognition of staffs in my Office
with my System so as to give them access Rights to some doors using
rapsbery pi
Also how can i set the tensorflow up to work on My Pycharm it always gives
me error from utils label_map_util

On Nov 6, 2017 7:00 PM, "Daniel Gleason" notifications@github.com wrote:

@alisidaniel https://github.com/alisidaniel What @sangeet259
https://github.com/sangeet259 said is true. You can't use those
commands on Windows. The commands won't work and you will download the
wrong installation anyway. You want to:

  1. Download the correct file: https://github.com/google/
    protobuf/releases/download/v3.3.0/protoc-3.3.0-win32.zip
    https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-win32.zip
  2. Unzip it
  3. Run the executable from the command line similar to my 2nd box
    above to compile the protobuf files for Python.
  4. Run setup.py install to install the new Python protobuf files.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/models/issues/1570#issuecomment-342232475,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATP8TLsWqiOKWpRVJfsEdOCLmM2VQ55Jks5sz0lKgaJpZM4N8Bkd
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbenami picture mbenami  Â·  3Comments

nmfisher picture nmfisher  Â·  3Comments

frankkloster picture frankkloster  Â·  3Comments

dsindex picture dsindex  Â·  3Comments

licaoyuan123 picture licaoyuan123  Â·  3Comments