This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import numpy as np | |
import scipy.io | |
import caffe | |
# take args for model arch (prototxt), input/output models (binaryproto ), | |
# layer name, and channel permutation. | |
arch_f, in_f, out_f = sys.argv[1:4] | |
layer = sys.argv[4] |