Error in ParseFromString() while reading lmdb: Tag had invalid wire type

115 views
Skip to first unread message

ankan

unread,
May 1, 2016, 1:15:25 AM5/1/16
to Caffe Users
I am trying to read a lmdb in Python using the following code:

import caffe
import lmdb

be_env
= lmdb.open('../be_train_lmdb')

be_txn
= be_env.begin()
be_cursor
= be_txn.cursor()

for key, value in be_cursor:
    datum
= caffe.proto.caffe_pb2.Datum()
    datum
.ParseFromString(value)
   
print datum.label, datum.channels, datum.height, datum.width


I keep getting a decode error from ParseFromString():
google.protobuf.message.DecodeError: Tag had invalid wire type.

What could be wrong with this?

Thank you.

Reply all
Reply to author
Forward
0 new messages