-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
Hi,
Thanks for sharing your great work! I am trying to use your pretrained models for prediction with the test airfoils. What I have tried so far is to load the model and state dict like this:
import torch
from train.DfpNet import TurbNetG
netG = TurbNetG()
model = netG.load_state_dict(torch.load('model_data05_exp50.pt'))What I get is an error like this with missing and mismatched layer sizes:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-5-0bda212c0edc> in <module>
----> 1 model = netG.load_state_dict(torch.load('model_data05_exp50.pt'))
~/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
1222 if len(error_msgs) > 0:
1223 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
-> 1224 self.__class__.__name__, "\n\t".join(error_msgs)))
1225 return _IncompatibleKeys(missing_keys, unexpected_keys)
1226
RuntimeError: Error(s) in loading state_dict for TurbNetG:
Missing key(s) in state_dict: "layer2b.layer2b_conv.weight", "layer2b.layer2b_conv.bias", "layer2b.layer2b_bn.weight", "layer2b.layer2b_bn.bias", "layer2b.layer2b_bn.running_mean", "layer2b.layer2b_bn.running_var", "dlayer2b.dlayer2b_tconv.weight", "dlayer2b.dlayer2b_tconv.bias", "dlayer2b.dlayer2b_bn.weight", "dlayer2b.dlayer2b_bn.bias", "dlayer2b.dlayer2b_bn.running_mean", "dlayer2b.dlayer2b_bn.running_var".
Unexpected key(s) in state_dict: "layer2x.layer2x_conv.weight", "layer2x.layer2x_conv.bias", "layer2x.layer2x_bn.weight", "layer2x.layer2x_bn.bias", "layer2x.layer2x_bn.running_mean", "layer2x.layer2x_bn.running_var", "layer2x.layer2x_bn.num_batches_tracked", "dlayer2x.dlayer2x_tconv.weight", "dlayer2x.dlayer2x_tconv.bias", "dlayer2x.dlayer2x_bn.weight", "dlayer2x.dlayer2x_bn.bias", "dlayer2x.dlayer2x_bn.running_mean", "dlayer2x.dlayer2x_bn.running_var", "dlayer2x.dlayer2x_bn.num_batches_tracked".
size mismatch for layer1.layer1_conv.weight: copying a param with shape torch.Size([32, 3, 4, 4]) from checkpoint, the shape in current model is torch.Size([64, 3, 4, 4]).
size mismatch for layer1.layer1_conv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for layer2.layer2_conv.weight: copying a param with shape torch.Size([64, 32, 4, 4]) from checkpoint, the shape in current model is torch.Size([128, 64, 4, 4]).
size mismatch for layer2.layer2_conv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer2.layer2_bn.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer2.layer2_bn.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer2.layer2_bn.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer2.layer2_bn.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer3.layer3_conv.weight: copying a param with shape torch.Size([128, 64, 4, 4]) from checkpoint, the shape in current model is torch.Size([256, 128, 4, 4]).
size mismatch for layer3.layer3_conv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for layer3.layer3_bn.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for layer3.layer3_bn.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for layer3.layer3_bn.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for layer3.layer3_bn.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for layer4.layer4_conv.weight: copying a param with shape torch.Size([256, 128, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 256, 4, 4]).
size mismatch for layer4.layer4_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer4.layer4_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer4.layer4_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer4.layer4_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer4.layer4_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer5.layer5_conv.weight: copying a param with shape torch.Size([256, 256, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 512, 2, 2]).
size mismatch for layer5.layer5_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer5.layer5_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer5.layer5_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer5.layer5_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer5.layer5_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for layer6.layer6_conv.weight: copying a param with shape torch.Size([256, 256, 2, 2]) from checkpoint, the shape in current model is torch.Size([512, 512, 2, 2]).
size mismatch for layer6.layer6_conv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer6.dlayer6_tconv.weight: copying a param with shape torch.Size([256, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dlayer6.dlayer6_tconv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer6.dlayer6_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer6.dlayer6_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer6.dlayer6_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer6.dlayer6_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer5.dlayer5_tconv.weight: copying a param with shape torch.Size([256, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1024, 1, 1]).
size mismatch for dlayer5.dlayer5_tconv.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer5.dlayer5_bn.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer5.dlayer5_bn.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer5.dlayer5_bn.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer5.dlayer5_bn.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for dlayer4.dlayer4_tconv.weight: copying a param with shape torch.Size([128, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 3]).
size mismatch for dlayer4.dlayer4_tconv.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for dlayer4.dlayer4_bn.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for dlayer4.dlayer4_bn.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for dlayer4.dlayer4_bn.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for dlayer4.dlayer4_bn.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]).
size mismatch for dlayer3.dlayer3_tconv.weight: copying a param with shape torch.Size([64, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 512, 3, 3]).
size mismatch for dlayer3.dlayer3_tconv.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for dlayer3.dlayer3_bn.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for dlayer3.dlayer3_bn.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for dlayer3.dlayer3_bn.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for dlayer3.dlayer3_bn.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for dlayer2.dlayer2_tconv.weight: copying a param with shape torch.Size([32, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 256, 3, 3]).
size mismatch for dlayer2.dlayer2_tconv.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for dlayer2.dlayer2_bn.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for dlayer2.dlayer2_bn.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for dlayer2.dlayer2_bn.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for dlayer2.dlayer2_bn.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for dlayer1.dlayer1_tconv.weight: copying a param with shape torch.Size([64, 3, 4, 4]) from checkpoint, the shape in current model is torch.Size([128, 3, 4, 4]).
Metadata
Metadata
Assignees
Labels
No labels