Models: How to fix the bug 鈥淓xpected "required", "optional", or "repeated".鈥濓紵

Created on 2 Jul 2017  路  12Comments  路  Source: tensorflow/models

When I use the commond " protoc object_detection/protos/*.proto --python_out=.",
The output:
object_detection/protos/anchor_generator.proto:11:3: Expected "required", "optio nal", or "repeated".
object_detection/protos/anchor_generator.proto:11:32: Missing field number.

builinstall

Most helpful comment

You need to download protoc version 3.3 (already compiled). Used protoc inside bin directory to run this command like this:
tensorflow$ mkdir protoc_3.3
tensorflow$ cd protoc_3.3
tensorflow/protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ chmod 775 protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ cd ../models/
tensorflow/protoc_3.3$ /home/humayun/tensorflow/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.

It will work hopefullly.

Humayun

All 12 comments

You need to download protoc version 3.3 (already compiled). Used protoc inside bin directory to run this command like this:
tensorflow$ mkdir protoc_3.3
tensorflow$ cd protoc_3.3
tensorflow/protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ chmod 775 protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ cd ../models/
tensorflow/protoc_3.3$ /home/humayun/tensorflow/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.

It will work hopefullly.

Humayun

Thank you.

This is the most useful post on this issue. Thank you for posting.

Closing as a duplicate.

Thanks for the help, This should be posted in the installation guide readme.

Thanks,it is helpful

You need to download protoc version 3.3 (already compiled). Use the protoc executable inside bin directory to run the commands like this:
tensorflow$ mkdir protoc_3.3
tensorflow$ cd protoc_3.3
tensorflow/protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ chmod 775 protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ unzip protoc-3.3.0-linux-x86_64.zip
tensorflow/protoc_3.3$ cd ../models/research/
tensorflow/models/research$ /home/saikishor/tensorflow/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.

It might hopefullly work.

Thanks a lot. It helps!

Could you be clear and specific:
Used protoc inside bin directory to run this -- which bin directory is this?

What path should this be in?
tensorflow$ mkdir protoc_3.3
tensorflow$ cd protoc_3.3
tensorflow/protoc_3.3$ wget wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip....

@P-a-i-s There we are pointing out to the protoc executable in the bin folder of protoc_3.3. As we do here in the below command:
/home/saikishor/tensorflow/protoc_3.3/bin/protoc object_detection/protos/*.proto --python_out=.

I have updated my above comment as well.

In my case, I have my directories something like this:
+~/tensorflow
-models
-protoc_3.3

/home/ubuntu/tensorflow/protoc_3.5/bin/protoc object_detection/protos/*.proto --python_out=.
@saikishor - worked like a charm - thanks a ton for the speedy response and clarity :)

My lack of linux understanding is killing me...
I can't find a "tensorflow/protoc_3.5" directory anywhere on my system.
I've followed the instructions on the page: https://github.com/wagonhelm/TF_ObjectDetection_API/blob/master/README.md, and under the "Using Native Python 3" section, when I get to the: protoc object_detection/protos/*.proto --python_out=.
I get the described error. Everyone above seems to have a "tensorflow" directory in their home directory, so I must have missed something simple. ??

when I type "locate tensorflow", it tells me it's in
/usr/local/lib/python3.5/dist-packages/tensorflow/
but there's no "bin" directory there.

Was this page helpful?
0 / 5 - 0 ratings