# 设定图片的shape格式为网络data层格式 transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape}) # 改变维度的顺序,由原始图片维度(width, height, channel)变为(channel, width, height) transformer.set_transpose('data', (2,0,1)) # 减去均值,注意要先将binaryproto格式均值文件转换为npy格式[此…