def load_caffe(path_prototxt='weights/resnetFCN.prototxt',
path_weights='weights/resnetFCN.caffemodel',
out_path='weights/resnetFCN.npy',
version='V1'):
# Load the caffe network
print (' --> Loading the caffe weights...')
net_caffe = caffe.Net(path_prototxt, path_weights, caffe.TEST)
layers_caffe = dict(zip(list(net_caffe._layer_names), net_caffe.layers))
# Convert weights
print (' --> Converting the caffe weights to numpy...')
weights_caffe = convert_weights(layers_caffe, v=version)
# Save weights
print (' --> Saving the weights in numpy...')
np.save(out_path, weights_caffe)
# Entry point of the script
评论列表
文章目录