Cannot copy Batchnorm weights, shape mismatch.

19 views
Skip to first unread message

William Kristian Juel

unread,
Apr 19, 2017, 6:12:46 AM4/19/17
to DIGITS Users

Hello,
I posted this in the nvidia/caffe and nvidia/DIGITS  github reository aswell, hope it is ok to post it here aswell.

The problem:
I have successfully trained a Resnet-50 from scratch on a 5 class problem, here is my prototxt resnet50.txt
I am on the nvidia caffe-0.15 branch, and i trained this network using DIGITS 5.

I want to use my trained caffemodel to calculate specificity and sensitivity on my test set (medical images), i have made this python script infer_many.txt to test a folder of images. (This works for me on other models that does not use batchnorm layers)

The problem here is i, for some reason, cannot copy my batchnorm layer weights. I get the following Error:


"Cannot copy param 0 weights from layer 'xbn_conv1'; shape mismatch. Source param shape is 1 64 1 1 (64); target param shape is 64 (64). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer. "


Obviously i could rename the layers, but this makes no sense since i do not want to retrain but rather use my already trained model to predict on a folder of test images.

Does anyone have a suggestion how to fix this mismatching problem ?

Heres is my deploy file deploy.txt

Reply all
Reply to author
Forward
0 new messages