如何配置Caffe deploy.prototxt?

时间:2015-10-02 16:55:47

标签: image-processing neural-network caffe conv-neural-network

我在此question上关注了@ypx说明。现在我想预测一些照片。所以我正在使用:

MODEL_FILE = '/tmp/deploy.prototxt'
PRETRAINED = '/tmp/ck.caffemodel'
IMAGE_FILE = '/tmp/img.png'

net = caffe.Classifier(MODEL_FILE, PRETRAINED, image_dims=(200, 200))

但是我收到了这条消息:

I1002 13:49:24.331648 28172 net.cpp:435] Input 0 -> data
I1002 13:49:24.331667 28172 layer_factory.hpp:76] Creating layer data
I1002 13:49:24.332259 28172 net.cpp:110] Creating Layer data
F1002 13:49:24.332272 28172 net.cpp:427] Top blob 'data' produced by multiple sources.
*** Check failure stack trace: ***

我认为我的问题出在我的deploy.prototxt文件中。 This is my deploy.prototxtThis is my train.prototxt

有人可以帮我配置我的部署文件吗?

1 个答案:

答案 0 :(得分:1)

您应该从部署网中删除培训输入层(第8-21行)。

也就是说,放弃这个:

layer {
  name: "data"
  type: "Data"
  top: "data"
  top: "label"
  transform_param {
    scale: 0.00392156862745
  }
  data_param {
    source: "/tmp/db"
    batch_size: 64
    backend: LMDB
  }
}