Jack Simpson
Jack Simpson

Reputation: 1711

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

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.

Upvotes: 0

Views: 1221

Answers (1)

Shai
Shai

Reputation: 114796

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".

Upvotes: 3

Related Questions