Failed to include caffe_pb2, things might go wrong!

101 views
Skip to first unread message

zap...@gmail.com

unread,
May 22, 2017, 9:26:46 AM5/22/17
to Caffe Users
when I import caffe in python3.4 I get the following error:
 
Failed to include caffe_pb2, things might go wrong!
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1063, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1085, in InternalParse
    (tag_bytes, new_pos) = local_ReadTag(buffer, pos)
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/decoder.py", line 181, in ReadTag
    while six.indexbytes(buffer, pos) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yibing/.local/install/caffe/python/caffe/__init__.py", line 4, in <module>
    from .proto.caffe_pb2 import TRAIN, TEST
  File "/home/yibing/.local/install/caffe/python/caffe/proto/caffe_pb2.py", line 799, in <module>
    options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\020\001')),
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/descriptor.py", line 869, in _ParseOptions
    message.ParseFromString(string)
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/message.py", line 185, in ParseFromString
    self.MergeFromString(serialized)
  File "/usr/local/lib/python3.4/dist-packages/google/protobuf/internal/python_message.py", line 1069, in MergeFromString
    raise message_mod.DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.

Reply all
Reply to author
Forward
0 new messages