Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in reading binaryproto in Python #3199

Closed
antran89 opened this issue Oct 15, 2015 · 1 comment
Closed

error in reading binaryproto in Python #3199

antran89 opened this issue Oct 15, 2015 · 1 comment

Comments

@antran89
Copy link
Contributor

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,

@antran89 antran89 changed the title reading binaryproto in Python error in reading binaryproto in Python Oct 15, 2015
@lukeyeager
Copy link
Contributor

I think #3170 is your culprit.

lukeyeager added a commit to lukeyeager/caffe that referenced this issue Oct 15, 2015
lukeyeager added a commit to lukeyeager/caffe that referenced this issue Oct 15, 2015
lukeyeager added a commit to lukeyeager/caffe that referenced this issue Oct 15, 2015
lukeyeager added a commit to lukeyeager/caffe that referenced this issue Oct 21, 2015
mtamburrano pushed a commit to mtamburrano/caffe that referenced this issue Nov 12, 2015
acmiyaguchi pushed a commit to acmiyaguchi/caffe that referenced this issue Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants