Caffe学习

将binaryproto转为npy

import caffe % suppose caffe is already in the path of Python
import numpy as np
import sys

blob = caffe.proto.caffe_pb2.BlobProto()
data = open( 'data/ilsvrc12/imagenet_mean.binaryproto' , 'rb' ).read()
blob.ParseFromString(data)
arr = np.array( caffe.io.blobproto_to_array(blob) )
arr.shape % check the shape of arr

 num_group理解示意图:

posted @ 2016-09-27 17:19  Key_Ky  阅读(166)  评论(0编辑  收藏  举报