您可以简单地使用numpy创建.binaryproto和给定的caffe io函数
import caffe#avg_img is your numpy array with the average data blob = caffe.io.array_to_blobproto( avg_img)with open( mean.binaryproto, 'wb' ) as f : f.write( blob.SerializeToString())

您可以简单地使用numpy创建.binaryproto和给定的caffe io函数
import caffe#avg_img is your numpy array with the average data blob = caffe.io.array_to_blobproto( avg_img)with open( mean.binaryproto, 'wb' ) as f : f.write( blob.SerializeToString())