Skip to content

Instantly share code, notes, and snippets.

@shelhamer
Last active November 9, 2020 00:46
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save shelhamer/fa948f336c5d8f42f0c3 to your computer and use it in GitHub Desktop.
Save shelhamer/fa948f336c5d8f42f0c3 to your computer and use it in GitHub Desktop.
Load binary proto .caffemodel to inspect layer names.
import sys
sys.path.insert(0, 'python/')
import caffe
from caffe.proto import caffe_pb2
net_param = caffe_pb2.NetParameter()
net_str = open('lenet_iter_5000.caffemodel', 'r').read()
net_param.ParseFromString(net_str)
print net_param.layer[0].name # first layer
print net_param.layer[-1].name # last layer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment