Closed samson-wang closed 7 years ago
Hi Samson, thanks for reporting this. The error is because bvlc_alexnet model with ccn2 backend requires the input image to be of the size (batch_size, 3, 227, 227) with batch_size being a multiple of 32. You would be able to use cudnn backend directly without any issues. Please let me know if it isn't clear.
Hi ramprs, thanks for your tips. 'cudnn' works fine.
However, if I use the finetuned model based on caffenet, the output dimension goes wrong. I finetune the caffenet for a 45-class task. The only difference is that the fc8 output num is 45. The lua-prototxt output layer of original is
table.insert(model, {'fc8', nn.Linear(4096, 1000)}) table.insert(model, {'loss', cudnn.SoftMax()})
Mine only has table.insert(model, {'fc8_ft', nn.Linear(4096, 45)})
And then the finetuned model predicted label has 4096 dimensions instead of 45.
Well, I found that there is a bug in loadcaffe.
@samson-wang Hi Samson, I met the same problem as yours. Have you solved your problem when using finetuned model?
@Darren1988
Yes. It's a bug in loadcaffe
. Please refer to the link above.
@Darren1988 You can use my fork of loadcaffe. https://github.com/samson-wang/loadcaffe
If I use the alexnet and backend set to 'ccn2'. The code crashes when doing network forward on line
local output = cnn:forward(img)
.