Skip to content

error in reading binaryproto in Python #3199

@antran89

Description

@antran89

Hi,
Today I met the odd.
I use the following snippet of code to reading binaryproto into npy array. The code is very standard that I found in #290, #808.

#test caffe
import caffe

MEAN_FILE = '/home/tranlaman/BLVC-caffe/data/ilsvrc12/imagenet_mean.binaryproto'
blob = caffe.proto.caffe_pb2.BlobProto()
data = open(MEAN_FILE, 'rb').read()
blob.ParseFromString(data)
arr = np.array(caffe.io.blobproto_to_array(blob))
out = arr[0]
print out.shape

The error is as follows

Traceback (most recent call last):
  File "/home/tranlaman/Desktop/python-workspace/test-python/test_python.py", line 34, in <module>
    arr = np.array(caffe.io.blobproto_to_array(blob))
  File "/home/tranlaman/BLVC-caffe/python/caffe/io.py", line 26, in blobproto_to_array
    return np.array(blob.data).reshape(*blob.shape.dim)
TypeError: function takes exactly 1 argument (0 given)

My caffe was installed properly. I run this code just fine with Caffe version of 1 month ago.
I am just asking is there any major changes in Caffe recent days.
Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions