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

Save from python for net surgery #455

Merged
merged 3 commits into from
Jun 12, 2014
Merged

Conversation

shelhamer
Copy link
Member

  1. Scheme desired parameters.
  2. Do surgery on the net through net.params['name'][idx].data[...] =.
  3. Save post-operation net params by net.save('fname').

Handwoven deep nets, anyone?

Surgeries done in this way:

  • Collecting R-CNN into a single Caffe model binaryproto: take the svm weights and bias and transplant to fc8.
  • Making a learned image classifier fully-convolutional for sliding window detection. Take the inner product layer weights, translate to convolution weights, and transplant the weight blobs to the new architecture. By re-formulating the classifiers as convolutions, a spatial classification map is generated on inputs of any size (> than the input dimensionality of the classifier).

@shelhamer
Copy link
Member Author

As requested in #450. Thanks for the reminder to push this.

@shelhamer
Copy link
Member Author

I'll add an example notebook of doing a surgery and seeing the change in results, then let's merge.

@Yangqing
Copy link
Member

Rowland Depp did a similar task to convert imagenet pretrained models to fully convolutional, involving some late night ipython hacking - it's a great-to-have feature :)

0. Scheme desired parameters.
1. Do surgery on the net through `net.params['name'][idx].data[...] = `.
2. Save post-operation net params by `net.save('fname')`.

Handwoven deep nets, anyone?
@shelhamer
Copy link
Member Author

@Yangqing I added a notebook detailing that very same model conversion.

Merging now that an example of net surgery is included.

shelhamer added a commit that referenced this pull request Jun 12, 2014
Save from python for net surgery
@shelhamer shelhamer merged commit 506e476 into BVLC:dev Jun 12, 2014
@shelhamer shelhamer deleted the pycaffe-save branch June 25, 2014 21:54
shelhamer added a commit that referenced this pull request Jul 15, 2014
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
Save from python for net surgery
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
RazvanRanca pushed a commit to RazvanRanca/caffe that referenced this pull request Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants