Skip to content

Conversation

@shaibagon
Copy link
Member

Currently, Blobs (especially inputs to net) with num_axes() != 4 are not supported by pycaffe interface.
This is because pycaffe uses .num property of Blob that is only supported for 4D Blobs.

This PR attempts to correct this by removing all references to Blob.num property (that assumes Blob is 4D).
Replacing it with accessing Blob.shape[0] that is good also for Blobs with num_axes() != 4

This is a very minor change code-wise

…). Replacing it with accessing Blob.shape[0] - for Blobs with num_axes() != 4
@shelhamer
Copy link
Member

Thanks for this small patch to make the pycaffe keyword args work.

More precisely, this is only an issue for num_axes > 4 and when passing blobs= or diffs= keyword args to the pycaffe forward(), backward() respectively. The pycaffe blob interface, the Net.{blobs,params} properties, and Net.{forward(),backward()} methods all work in N-D.

shelhamer added a commit that referenced this pull request Feb 25, 2016
[pycaffe] make pycaffe support N-D blobs throughout
@shelhamer shelhamer merged commit 08766ff into BVLC:master Feb 25, 2016
@shaibagon
Copy link
Member Author

@shelhamer
Thanks for accepting this PR.

@shaibagon shaibagon deleted the pycaffe_nd_blobs branch February 25, 2016 12:01
fxbit pushed a commit to Yodigram/caffe that referenced this pull request Sep 1, 2016
[pycaffe] make pycaffe support N-D blobs throughout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants