caffe icon indicating copy to clipboard operation
caffe copied to clipboard

protobuf 2.6.0 breaks pycaffe on OS X

Open shelhamer opened this issue 12 years ago • 9 comments

Stay at 2.5.0 or downgrade. Otherwise import caffe gives

/Users/shelhamer/python/caffe/proto/caffe_pb2.py in <module>()
      8 from google.protobuf import message as _message
      9 from google.protobuf import reflection as _reflection
---> 10 from google.protobuf import symbol_database as _symbol_database
     11 from google.protobuf import descriptor_pb2
     12 # @@protoc_insertion_point(imports)

ImportError: cannot import name symbol_database

shelhamer avatar Oct 01 '14 19:10 shelhamer

(Not sure if relevant - maybe python and c++ are invoking different protobuf versions? E.g. the protoc binary is 2.6, but python is linked with protoc 2.5. I've had problems when I mixed 2.4 and 2.5 in the past.)

Yangqing avatar Oct 03 '14 23:10 Yangqing

A version difference is a reasonable culprit but it's not the problem here: I made caffe and pycaffe with the same proto lib linking and same protoc version, 2.6.0, and it doesn't work.

There's a different error if I try different versions for one or the other.

On Fri, Oct 3, 2014 at 4:42 PM, Yangqing Jia [email protected] wrote:

(Not sure if relevant - maybe python and c++ are invoking different protobuf versions? E.g. the protoc binary is 2.6, but python is linked with protoc 2.5. I've had problems when I mixed 2.4 and 2.5 in the past.)

— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1202#issuecomment-57881483.

shelhamer avatar Oct 04 '14 00:10 shelhamer

I am having this issue with protobuf 2.5.0 . Please let me know if there is a fix for this issue

sanjeev87 avatar Oct 13 '14 05:10 sanjeev87

If @Yangqing is right, there is another reason to take #1267 seriously.

kloudkl avatar Oct 13 '14 15:10 kloudkl

I'm having the same problem here with protobuf 2.5.0, latest caffe and CUDA 6.5. I'd appreciate if someone has a solution. Did you find a fix @sanjeev87?

anguyen8 avatar Jan 03 '15 23:01 anguyen8

I'm getting the exact same error when I try to run https://github.com/google/grr on travis. Perhaps it's something we're doing wrong with protobufs instead of a project issue?

If you find a solution, please let us know. Thanks!

dionyziz avatar Jan 05 '15 11:01 dionyziz

@dionyziz : I was using Python Anaconda and installed Protobuf python lib on it. My problem was fixed when I switched to not using Anaconda.

anguyen8 avatar Jan 05 '15 15:01 anguyen8

This was a protobuf version error for me. I solved it by switching from protobuf==2.5.0 to protobuf==2.6.0. Thanks for getting back to me @anguyen8!

dionyziz avatar Jan 05 '15 17:01 dionyziz

Not sure what the problem was back then, but protobuf 2.6.1 works on OS X -- closing.

shelhamer avatar Jan 16 '15 00:01 shelhamer