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

Object Detection: Protobuf files fail to compile with v.2.6.1 protobuf-compiler #4047

Closed
mastash3ff opened this issue Apr 21, 2018 · 8 comments
Assignees
Labels
stat:awaiting model gardener Waiting on input from TensorFlow model gardener

Comments

@mastash3ff
Copy link

mastash3ff commented Apr 21, 2018

Problem

Failure to compile .protos with Ubuntu 16.04.4 'protobuf-compiler' v2.6.1 package.

root@f046cb331de6:/tensorflow/models/research# cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
...
root@f046cb331de6:/tensorflow/models/research# python --version
Python 3.5.2
root@f046cb331de6:/tensorflow/models/research# protoc --version
libprotoc 2.6.1
root@f046cb331de6:/tensorflow/models/research# protoc object_detection/protos/*.proto --python_out=.
object_detection/protos/ssd.proto:87:3: Expected "required", "optional", or "repeated".
object_detection/protos/ssd.proto:87:12: Expected field name.
object_detection/protos/model.proto: Import "object_detection/protos/ssd.proto" was not found or had errors.
object_detection/protos/model.proto:12:5: "Ssd" is not defined.

Solution

Edit: Not the correct solution - See following comment

Compiled Protobuf from source, v3.5.1, and it fixed the issue with compiling. Installation instructions state to use Protobuf 2.6. This may need to be reconsidered.
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

root@f046cb331de6:/tensorflow/models/research# /usr/local/bin/protoc  --version
libprotoc 3.5.1
root@f046cb331de6:/tensorflow/models/research# /usr/local/bin/protoc object_detection/protos/*.proto --python_out=.
root@f046cb331de6:/tensorflow/models/research#
@mastash3ff
Copy link
Author

mastash3ff commented Apr 21, 2018

The solution recommended did not end up working for runtime. Apparently there are Protobuf2 dependencies.

Ended up finding out the issue with Protobuf2 compilation. A week ago a new introduction was added that broke compilation of ssd.proto line 87 6b72b5c

Removed that line and tests pass. Able to run tutorial to completion successfully now.

@hustc12
Copy link

hustc12 commented Apr 26, 2018

Meet this issue, too. But thanks to @mastash3ff's solution, it works.

@AliceDinh
Copy link

@huzq85 What line did you remove?

@AliceDinh
Copy link

@mastash3ff what line should I remove please

@hustc12
Copy link

hustc12 commented May 3, 2018

@AliceDinh , line 87: reserved 6;

@derekjchow
Copy link
Contributor

We updated the installation dependencies to require Protobuf 3+.

@dakoner
Copy link

dakoner commented May 24, 2018

The instructions list Protobuf 3+ as a dependency, but provide examples on Ubuntu 16.04 that install the protobuf 2 compiler:
The remaining libraries can be installed on Ubuntu 16.04 using via apt-get:

sudo apt-get install protobuf-compiler python-pil python-lxml python-tk

The problem is that many people are still using Ubuntu 16.04 (tensorflow default build platform), and there aren't any convenient packages on 16.04 that provide the newer protobuf compiler. So the install docs don't actually work unless you remove the 'reserved' keyword.

@yhliang2018 yhliang2018 added the stat:awaiting model gardener Waiting on input from TensorFlow model gardener label May 24, 2018
@elginkbeloy
Copy link

@AliceDinh , line 87: reserved 6;

The latest clone has reserved 6; on line 147. Removing this line worked for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting model gardener Waiting on input from TensorFlow model gardener
Projects
None yet
Development

No branches or pull requests

7 participants