Weather_Effect_Generator icon indicating copy to clipboard operation
Weather_Effect_Generator copied to clipboard

Pretrained weights do not load correctly

Open severecoder opened this issue 1 year ago • 2 comments

The style transfer loads has the following keys odict_keys(['features.0.weight', 'features.0.bias', 'features.2.weight', 'features.2.bias', 'features.5.weight', 'features.5.bias', 'features.7.weight', 'features.7.bias', 'features.10.weight', 'features.10.bias', 'features.12.weight', 'features.12.bias', 'features.14.weight', 'features.14.bias', 'features.16.weight', 'features.16.bias', 'features.19.weight', 'features.19.bias', 'features.21.weight', 'features.21.bias', 'features.23.weight', 'features.23.bias', 'features.25.weight', 'features.25.bias', 'features.28.weight', 'features.28.bias', 'features.30.weight', 'features.30.bias', 'features.32.weight', 'features.32.bias', 'features.34.weight', 'features.34.bias', 'classifier.0.weight', 'classifier.0.bias', 'classifier.3.weight', 'classifier.3.bias', 'classifier.6.weight', 'classifier.6.bias']). It does not have the model key to load the model. Please recommend the best way to load the weights.

severecoder avatar Apr 04 '24 05:04 severecoder

I have updated the code to fix the bug while loading the model for the style transfer network. Please try again with the new changes.

Let me know if you still face problems.

hgupta01 avatar Apr 04 '24 09:04 hgupta01

Thank you.

However, this brings this error on line target_feature = model(style_img).detach() inside style_transfer_utils.py

The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 1

severecoder avatar Apr 04 '24 14:04 severecoder