Pickling of "caffe._caffe.Blob" instances is not enabled

462 views
Skip to first unread message

Sara Sabour

unread,
Sep 2, 2015, 4:04:23 PM9/2/15
to Caffe Users
Hi,

The "Pickling of "caffe._caffe.Blob" instances is not enabled" error comes up when I try to pickle the net.blobs dictionary in python. I'm on CentOS with python 2.7. How can I enable pickling the caffe.blob?

Thanks,
Sara

Eric Romanenghi

unread,
Oct 20, 2015, 3:46:06 PM10/20/15
to Caffe Users
Hi!

Could you solve the problem?

Jan C Peters

unread,
Oct 21, 2015, 7:26:15 AM10/21/15
to Caffe Users
Pickling is only supported on python's built-in data structures and composites of those. The caffe._caffe.Blob is merely a python interface to the underlying C++ datastructure.

But why would you want to do that anyway? For serialization you could either use the protobuf format (which is kinda 'native' to caffe), or convert the contents of the blob to a multidimensional numpy array, and save this to a npy file:

blobdata = np.array(net.blobs['blobname'].data[:], dtype=float, copy=True)
np
.save('blob.npy',blobdata)

Anuj Modi

unread,
Nov 11, 2016, 9:34:14 AM11/11/16
to Caffe Users
Did this work?
Reply all
Reply to author
Forward
0 new messages