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

被刻印的时光 ゝ 提交于 2019-12-11 14:38:32

问题


I 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 (replacing the train and test layers with the input layer).

Unfortunately, when I run the C++ program it gives me the following error:

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

I tried to Google it and I think there's some difference between the layers in the files for the MNIST and C++ examples but can't work out what I can change to make this work.


回答1:


As pointed out by AbdulRahman AlHamali's comment it seems like you left in your deploy.prototxt file the loss and accuracy layers that expects as inputs ("bottom"s) "label".
Removing these loss layers from deploy.prototxt should solve the poroblem.

Note, that if you used "SoftmaxWithLoss" layer as a loss, you need to replace it with a "Softmax" layer to get class probabilities as the net outputs. "Softmax" layer takes only one "bottom" and does not require bottom: "label".



来源:https://stackoverflow.com/questions/32241193/error-with-caffe-c-example-with-different-deploy-prototxt-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!