DeepShift icon indicating copy to clipboard operation
DeepShift copied to clipboard

Inference on pre-trained model using PS type

Open kokhazade opened this issue 1 year ago • 0 comments

Hi,

How can I use -e option to do evaluation for a trained model that has used PS shift type? By running the following command: CUDA_VISIBLE_DEVICES=0 python cifar10.py --arch resnet18 -e --weights models/cifar10/resnet18/shift_ps_all_wb_5/checkpoint.pth.tar

I get the following error:

RuntimeError: Error(s) in loading state_dict for ResNet:
        Missing key(s) in state_dict: "conv1.weight", "layer1.0.conv1.weight", "layer1.0.conv2.weight", "layer1.1.conv1.weight", "layer1.1.conv2.weight", "layer2.0.conv1.weight", "layer2.0.conv2.weight", "layer2.1.conv1.weight", "layer2.1.conv2.weight", "layer3.0.conv1.weight", "layer3.0.conv2.weight", "layer3.1.conv1.weight", "layer3.1.conv2.weight", "layer4.0.conv1.weight", "layer4.0.conv2.weight", "layer4.1.conv1.weight", "layer4.1.conv2.weight", "linear.weight". 
        Unexpected key(s) in state_dict: "conv1.shift", "conv1.sign", "layer1.0.conv1.shift", "layer1.0.conv1.sign", "layer1.0.conv2.shift", "layer1.0.conv2.sign", "layer1.1.conv1.shift", "layer1.1.conv1.sign", "layer1.1.conv2.shift", "layer1.1.conv2.sign", "layer2.0.conv1.shift", "layer2.0.conv1.sign", "layer2.0.conv2.shift", "layer2.0.conv2.sign", "layer2.1.conv1.shift", "layer2.1.conv1.sign", "layer2.1.conv2.shift", "layer2.1.conv2.sign", "layer3.0.conv1.shift", "layer3.0.conv1.sign", "layer3.0.conv2.shift", "layer3.0.conv2.sign", "layer3.1.conv1.shift", "layer3.1.conv1.sign", "layer3.1.conv2.shift", "layer3.1.conv2.sign", "layer4.0.conv1.shift", "layer4.0.conv1.sign", "layer4.0.conv2.shift", "layer4.0.conv2.sign", "layer4.1.conv1.shift", "layer4.1.conv1.sign", "layer4.1.conv2.shift", "layer4.1.conv2.sign", "linear.shift", "linear.sign".

kokhazade avatar Dec 20 '24 10:12 kokhazade