ehuynh1106 / TinyImageNet-Transformers

Transformers trained on Tiny ImageNet
Apache License 2.0
46 stars 11 forks source link

swin_large_patch4_window12_384 timm model doesn't match the provided checkpoint #5

Closed AaronPeng920 closed 10 months ago

AaronPeng920 commented 10 months ago

aise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SwinTransformer: Missing key(s) in state_dict: "layers.3.downsample.norm.weight", "layers.3.downsample.norm.bias", "layers.3.downsample.reduction.weight", "head.fc.weight", "head.fc.bias". Unexpected key(s) in state_dict: "layers.0.downsample.norm.weight", " ............

ehuynh1106 commented 10 months ago

Hi Aaron,

Did you use the requirements.txt file to install the specific timm version? Newer versions of timm are likely incompatible with these weights.

I was able to evaluate the swin model with a 91.35% accuracy using the following commands:

pip install -r requirements.txt

python .\main.py --model swin --evaluate https://github.com/ehuynh1106/TinyImageNet-Transformers/releases/download/weights/swin_large_384.pth