akolesnikoff / SEC

Seed, Expand, Constrain: Three Principles for Weakly-Supervised Image Segmentation
MIT License
244 stars 68 forks source link

Recommended caffe version? / Incompatible protobufs #6

Closed nightrome closed 7 years ago

nightrome commented 7 years ago

Hi, could you indicate which version of caffe you have been using this with? I have just used the latest version of caffe-master, but somehow the protobufs seem to be incompatible.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pylayers/__init__.py", line 1, in <module>
    from .pylayers import *
  File "/usr/local/lib/python2.7/dist-packages/pylayers/pylayers.py", line 1, in <module>
    import caffe
  File "/home/holger/caffe/python/caffe/__init__.py", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
  File "/home/holger/caffe/python/caffe/pycaffe.py", line 15, in <module>
    import caffe.io
  File "/home/holger/caffe/python/caffe/io.py", line 8, in <module>
    from caffe.proto import caffe_pb2
  File "/home/holger/caffe/python/caffe/proto/caffe_pb2.py", line 11, in <module>
    from google.protobuf import descriptor_pb2
  File "/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor_pb2.py", line 213, in <module>
    serialized_end=3897,
  File "/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 602, in __new__
    return _message.default_pool.FindEnumTypeByName(full_name)
KeyError: "Couldn't find enum google.protobuf.FieldOptions.JSType"
kolesman commented 7 years ago

Hi,

If I remember correctly, I've tested the code with this snapshot of caffe: https://github.com/BVLC/caffe/commit/b2982c7eef65a1b94db6f22fb8bb7caa986e6f29

nightrome commented 7 years ago

Thanks for the quick response. With that snapshot it seems to work.

daobinhuang commented 7 years ago

Hi, I have reinstall caffe (BVLC/caffe@b2982c7) as nightrome do, but i still got the same error, could you tell me which version of protobuf used in your project. Thanks

nightrome commented 7 years ago

Hi, for me it worked with libprotoc 2.6.1. At least that's what protoc --version outputs.

daobinhuang commented 7 years ago

Thanks for your response, I have solved this problem by reinstall protobuf(pip install --user --upgrade protobuf==3.1.0.post1) . thanks again!