caffe Python API 之中值转换
# 编写一个函数,将二进制的均值转换为python的均值 def convert_mean(binMean,npyMean): blob = caffe.proto.caffe_pb2.BlobProto() bin_mean = open(binMean, 'rb' ).read() blob.ParseFromString(bin_mean) arr = np.array( caffe.io.blobproto_to_array(blob) ) npy_mean = arr[0] np.save(npyMean, npy_mean ) # 调用函数转换均值 binMean='examples/cifar10/mean.binaryproto' npyMean='examples/cifar10/mean.npy' convert_mean(binMean,npyMean)
手与大脑的距离决定了理想与现实的相似度