使用 ipython 时:
net = caffe.Classifier(MODEL_FILE, PRETRAINED)
当我使用原始 train.prototxt 作为 pretrained_file(PRETRAINED) 时出现异常
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-af51e3c78bed> in <module>()
2 plt.rcParams['image.interpolation'] = 'nearest'
3 plt.rcParams['image.cmap'] = 'gray'
----> 4 net = caffe.Classifier(MODEL_FILE, PRETRAINED)
/home/xiayu/work/caffe/caffe-master/python/caffe/classifier.pyc in
__init__(self, model_file, pretrained_file, image_dims, mean, input_scale, raw_scale, channel_swap)
27
28 # configure pre-processing
---> 29 in_ = self.inputs[0]
30 self.transformer = caffe.io.Transformer(
31 {in_: self.blobs[in_].data.shape})
IndexError: list index out of range
我不知道为什么in_ = self.inputs[0]
索引0
超出范围,在这里我知道指定的 deploy.prototxt 可能有效,但我不知道如何。
真的希望有人能回答我的问题!