在 caffe 模块中找不到 Transformer 函数

Cannot find Transformer function in module in caffe

这是我在 运行 用于预处理图像的变换函数时得到的错误。

回溯(最后一次调用): 文件 "tst.py",第 18 行,在

变压器=caffe.io.Transformer({'data':net.blobs['data'].data.shape}) AttributeError: 'module' 对象没有属性 'Transformer'

其实我也想通了

io.py 文件不包含 class 转换器。也许它在修改后的咖啡中丢失了。我从原始 BVLC caffe 中取出 class 并将其粘贴到 io.py 文件中。 Link 到 io.py 的 BVLC caffe https://github.com/BVLC/caffe/blob/master/python/caffe/io.py

适合我。