使用不同 deploy.prototxt 文件的 Caffe C++ 示例出错

Error with Caffe C++ example with different deploy.prototxt file

trained a model using the MNIST example architecture (but on my own set of 3 image classes) and have been trying to integrate it into the C++ example. I modified the MNIST architecture file to make it similar to the deploy.prototxt file for the C++ example ()。

不幸的是,当我 运行 C++ 程序时,它给了我以下错误:

F0827 14:57:28.427697 25511 insert_splits.cpp:35] Unknown bottom blob 'label' (layer 'accuracy', bottom index 1)

我尝试 Google 它,我认为 MNIST 和 C++ 示例文件中的层之间存在一些差异,但无法弄清楚我可以更改哪些内容来使这项工作正常进行。

正如 所指出的那样,您似乎在 deploy.prototxt 文件中留下了期望作为输入的损失和精度层 ("bottom"s) "label"
deploy.prototxt 中删除这些损失层应该可以解决问题。

注意,如果你使用"SoftmaxWithLoss"层作为损失,你需要"Softmax"层替换它以获得class 概率作为净输出。 "Softmax"层只需要一个"bottom",不需要bottom: "label".