AI4HealthUOL / SSSD

Repository for the paper: 'Diffusion-based Time Series Imputation and Forecasting with Structured State Space Models'
MIT License
270 stars 47 forks source link

The errors with pretrained model loading #4

Closed YangYu-NUAA closed 1 year ago

YangYu-NUAA commented 1 year ago

Hi, When I try to load my pretrained model, the following issue occurs: size mismatch for residual_layer.residual_blocks.35.S42.s4_layer.kernel.kernel.omega: copying a param with shape torch.Size([101, 2]) from checkpoint, the shape in current model is torch.Size([51, 2]). size mismatch for residual_layer.residual_blocks.35.S42.s4_layer.kernel.kernel.z: copying a param with shape torch.Size([101, 2]) from checkpoint, the shape in current model is torch.Size([51, 2]). The model architecture between training phase and inference phase are the same. Can you give me some advise?

juanlopezcode commented 1 year ago

Hello Yang, this erros seems to be from your S4 model (layers), I faced the error at least once when I run an experiment and forgot to change the hyperparameter of S4_lmax in the configuration file. The value there should always be the total length of your sample time steps, otherwise during training S4 will set a value there that during inference later on wouldn't match your model weights.