iSEE-Laboratory/DiffUIR

关于测试

Closed this issue · 1 comments

您好,训练时一切正常,但是在进行测试时,报了如下的错误(参数没有改动,仅修改了图片数据的路径)请问可能是什么问题导致的呢?非常感谢!
Traceback (most recent call last):
File "test.py", line 100, in
trainer.load(300)
File "/home/CVPR2024/src/model.py", line 1255, in load
self.model.load_state_dict(data['model'])
File "/home/.conda/envs/lyt_torch1.10/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1483, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResidualDiffusion:
size mismatch for model.unet0.downs.3.3.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 256, 3, 3]).
size mismatch for model.unet0.downs.3.3.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]).
size mismatch for model.unet0.ups.0.0.mlp.1.weight: copying a param with shape torch.Size([512, 256]) from checkpoint, the shape in current model is torch.Size([1024, 256]).
size mismatch for model.unet0.ups.0.0.mlp.1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]).
size mismatch for model.unet0.ups.0.0.block1.proj.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 768, 3, 3]).

就是写模型加载上的问题,自己debug一下吧。。。。。