Skip to content

Instantly share code, notes, and snippets.

@jxnl
Created April 18, 2016 22:28
Show Gist options
  • Save jxnl/bf8994690794db57e60ba6e47c162bdb to your computer and use it in GitHub Desktop.
Save jxnl/bf8994690794db57e60ba6e47c162bdb to your computer and use it in GitHub Desktop.
from chainer.links import caffe
func = caffe.CaffeFunction("../bvlc_alexnet.caffemodel")
# construct a correctly sized chainer variable
x = chainer.Variable(...)
# outputs is a list of layers to extract and it will return
# each layer seperatly
fc7, = func(inputs={"data":x}, outputs=["fc7"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment