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

protoc error #43

Closed
a-maci opened this issue Nov 4, 2016 · 6 comments
Closed

protoc error #43

a-maci opened this issue Nov 4, 2016 · 6 comments

Comments

@a-maci
Copy link

a-maci commented Nov 4, 2016

Which version of protoc is required by tensorpack/tensorpack/utils/loadcaffe.py line 119?
I have 2.6.1 and I get an error saying
"caffe proto compilation failed! Did you install protoc?"
AssertionError: caffe proto compilation failed! Did you install protoc?

I am on Ubuntu 16.04, running CUDA 8 and CUDNN 5.

@ppwwyyxx
Copy link
Collaborator

ppwwyyxx commented Nov 4, 2016

2.6.1 is OK.
The function is straightforward:

def get_caffe_pb():
    dir = get_dataset_path('caffe')
    caffe_pb_file = os.path.join(dir, 'caffe_pb2.py')
    if not os.path.isfile(caffe_pb_file):
        proto_path = download(CAFFE_PROTO_URL, dir)
        ret = os.system('cd {} && protoc caffe.proto --python_out .'.format(dir))
        assert ret == 0, \
                "caffe proto compilation failed! Did you install protoc?"

Maybe it failed to download the file successfully. Or maybe protoc isn't in your path. You can also run protoc caffe.proto --python_out . yourself to fix this.

@a-maci
Copy link
Author

a-maci commented Nov 4, 2016

protoc is in my path. The error is in compiling the caffe.proto file which I hadnt noticed before.

I get this error message upon compiling:
protoc caffe.proto --python_out=.
caffe.proto:1:1: Expected top-level statement (e.g. "message").

Any chance they updated the caffe.proto file (the file was last updated 4 months ago). Any chance you could upload your caffe.proto file in this repo?

Need help.

@ppwwyyxx
Copy link
Collaborator

ppwwyyxx commented Nov 4, 2016

protocolbuffers/protobuf#592 Does this help?

@a-maci
Copy link
Author

a-maci commented Nov 4, 2016

No, the link ends with "Will update our parser to ignore BOM". I dont know if protoc 2.6.1 incorporates this. I downloaded protoc 3.1.0 and I still get the above error. I wonder how it works for other people using protoc 2.6.1.

@ppwwyyxx
Copy link
Collaborator

ppwwyyxx commented Nov 4, 2016

It works for others because caffe.proto doesn't have BOM.
Will you check your caffe.proto is downloaded correctly? Maybe it's not BOM but other unexpected characters.
I also tried 16.04.

@ppwwyyxx
Copy link
Collaborator

ppwwyyxx commented Nov 4, 2016

Broken proto file. Closed.

@ppwwyyxx ppwwyyxx closed this as completed Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants