models icon indicating copy to clipboard operation
models copied to clipboard

How to fix the bug “Expected "required", "optional", or "repeated".”?

Open amazingzby opened this issue 9 years ago • 12 comments

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.

amazingzby avatar Jul 02 '17 07:07 amazingzby

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

humayun avatar Jul 02 '17 07:07 humayun

Thank you.

amazingzby avatar Jul 02 '17 11:07 amazingzby

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

shresthamalik avatar Jul 05 '17 21:07 shresthamalik

Closing as a duplicate.

aselle avatar Jul 07 '17 18:07 aselle

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

jahdiel avatar Jul 19 '17 18:07 jahdiel

Thanks,it is helpful

changquanyou avatar Sep 06 '17 15:09 changquanyou

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.

saikishor avatar Sep 27 '17 14:09 saikishor

Thanks a lot. It helps!

threshold2000 avatar Oct 20 '17 13:10 threshold2000

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 avatar Jan 15 '18 07:01 P-a-i-s

@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

saikishor avatar Jan 15 '18 07:01 saikishor

/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 :)

P-a-i-s avatar Jan 15 '18 07:01 P-a-i-s

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.

rbgreenway avatar Apr 18 '18 19:04 rbgreenway