import caffe import numpy as np mean = np.load('mean.npy').mean(1).mean(1) image_dims = (224, 244) model = 'deploy.prototxt' weights = 'resnet-50.caffemodel' net = caffe.Classifier(model, weights, image_dims=image_dims, mean=mean, raw_scale=255, channel_swap=[2, 1, 0]) nb = net.blobs for ctr, name in enumerate(nb): print(ctr, name, nb[name].data.shape)