models icon indicating copy to clipboard operation
models copied to clipboard

Error in Protobuf libraries compilation during installing Object Detection API

Open MoAbd opened this issue 9 years ago • 20 comments

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

MoAbd avatar Jun 16 '17 04:06 MoAbd

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?

abhiML avatar Jun 16 '17 07:06 abhiML

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

laowu8615 avatar Jun 16 '17 07:06 laowu8615

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

FlorianElias7 avatar Jun 16 '17 12:06 FlorianElias7

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

thhung avatar Jun 16 '17 15:06 thhung

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

jrbtaylor avatar Jun 16 '17 17:06 jrbtaylor

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

jch1 avatar Jun 16 '17 17:06 jch1

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

nealwu avatar Jun 16 '17 22:06 nealwu

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

nealwu avatar Jun 16 '17 22:06 nealwu

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'

MoAbd avatar Jun 17 '17 00:06 MoAbd

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.

nealwu avatar Jun 19 '17 20:06 nealwu

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

jaimeet64 avatar Aug 16 '17 07:08 jaimeet64

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

hephaex avatar Aug 17 '17 07:08 hephaex

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.

liuquande avatar Aug 24 '17 03:08 liuquande

I am having the same problem as well!

astorfi avatar Sep 05 '17 15:09 astorfi

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=~

dnlglsn avatar Sep 13 '17 22:09 dnlglsn

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 avatar Nov 06 '17 16:11 alisidaniel

@alisidaniel No these are bash commands.

sangeet259 avatar Nov 06 '17 17:11 sangeet259

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

dnlglsn avatar Nov 06 '17 17:11 dnlglsn

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" [email protected] 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 .

alisidaniel avatar Nov 07 '17 11:11 alisidaniel

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" [email protected] 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 .

alisidaniel avatar Nov 07 '17 12:11 alisidaniel