INVOKERer / DeepRFT

The code for 'Intriguing Findings of Frequency Selection for Image Deblurring' and 'Deep Residual Fourier Transformation for Single Image Deblurring'
Other
244 stars 32 forks source link

使用给的预训练模型进行测试报错 #64

Open ziFan99 opened 3 days ago

ziFan99 commented 3 days ago

作者你好,我使用链接进行下载的预训练权重进行测试,报如下错误,我想问一下这个是预训练模型本身的错误还是我哪里出错了?希望作者可以抽空解答一下我的疑惑。

Total: 9551088 Trainable: 9551088 /root/autodl-tmp/DeepRFT-main/utils/model_utils.py:39: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load(weights) Traceback (most recent call last): File "test.py", line 38, in utils.load_checkpoint_compress_doconv(model_restoration, args.weights) File "/root/autodl-tmp/DeepRFT-main/utils/model_utils.py", line 79, in load_checkpoint_compress_doconv model.load_state_dict(do_state_dict) File "/root/miniconda3/envs/DeepRFT/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2215, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for DeepRFT: Missing key(s) in state_dict: "Encoder.0.layers.4.main.0.main.0.W", "Encoder.0.layers.4.main.1.main.0.W", "Encoder.0.layers.4.main_fft.0.main.0.W", "Encoder.0.layers.4.main_fft.1.main.0.W", "Encoder.0.layers.5.main.0.main.0.W", "Encoder.0.layers.5.main.1.main.0.W", "Encoder.0.layers.5.main_fft.0.main.0.W", "Encoder.0.layers.5.main_fft.1.main.0.W", "Encoder.0.layers.6.main.0.main.0.W", "Encoder.0.layers.6.main.1.main.0.W", "Encoder.0.layers.6.main_fft.0.main.0.W", "Encoder.0.layers.6.main_fft.1.main.0.W", "Encoder.0.layers.7.main.0.main.0.W", "Encoder.0.layers.7.main.1.main.0.W", "Encoder.0.layers.7.main_fft.0.main.0.W", "Encoder.0.layers.7.main_fft.1.main.0.W", "Encoder.1.layers.4.main.0.main.0.W", "Encoder.1.layers.4.main.1.main.0.W", "Encoder.1.layers.4.main_fft.0.main.0.W", "Encoder.1.layers.4.main_fft.1.main.0.W", "Encoder.1.layers.5.main.0.main.0.W", "Encoder.1.layers.5.main.1.main.0.W", "Encoder.1.layers.5.main_fft.0.main.0.W", "Encoder.1.layers.5.main_fft.1.main.0.W", "Encoder.1.layers.6.main.0.main.0.W", "Encoder.1.layers.6.main.1.main.0.W", "Encoder.1.layers.6.main_fft.0.main.0.W", "Encoder.1.layers.6.main_fft.1.main.0.W", "Encoder.1.layers.7.main.0.main.0.W", "Encoder.1.layers.7.main.1.main.0.W", "Encoder.1.layers.7.main_fft.0.main.0.W", "Encoder.1.layers.7.main_fft.1.main.0.W", "Encoder.2.layers.4.main.0.main.0.W", "Encoder.2.layers.4.main.1.main.0.W", "Encoder.2.layers.4.main_fft.0.main.0.W", "Encoder.2.layers.4.main_fft.1.main.0.W", "Encoder.2.layers.5.main.0.main.0.W", "Encoder.2.layers.5.main.1.main.0.W", "Encoder.2.layers.5.main_fft.0.main.0.W", "Encoder.2.layers.5.main_fft.1.main.0.W", "Encoder.2.layers.6.main.0.main.0.W", "Encoder.2.layers.6.main.1.main.0.W", "Encoder.2.layers.6.main_fft.0.main.0.W", "Encoder.2.layers.6.main_fft.1.main.0.W", "Encoder.2.layers.7.main.0.main.0.W", "Encoder.2.layers.7.main.1.main.0.W", "Encoder.2.layers.7.main_fft.0.main.0.W", "Encoder.2.layers.7.main_fft.1.main.0.W", "Decoder.0.layers.4.main.0.main.0.W", "Decoder.0.layers.4.main.1.main.0.W", "Decoder.0.layers.4.main_fft.0.main.0.W", "Decoder.0.layers.4.main_fft.1.main.0.W", "Decoder.0.layers.5.main.0.main.0.W", "Decoder.0.layers.5.main.1.main.0.W", "Decoder.0.layers.5.main_fft.0.main.0.W", "Decoder.0.layers.5.main_fft.1.main.0.W", "Decoder.0.layers.6.main.0.main.0.W", "Decoder.0.layers.6.main.1.main.0.W", "Decoder.0.layers.6.main_fft.0.main.0.W", "Decoder.0.layers.6.main_fft.1.main.0.W", "Decoder.0.layers.7.main.0.main.0.W", "Decoder.0.layers.7.main.1.main.0.W", "Decoder.0.layers.7.main_fft.0.main.0.W", "Decoder.0.layers.7.main_fft.1.main.0.W", "Decoder.1.layers.4.main.0.main.0.W", "Decoder.1.layers.4.main.1.main.0.W", "Decoder.1.layers.4.main_fft.0.main.0.W", "Decoder.1.layers.4.main_fft.1.main.0.W", "Decoder.1.layers.5.main.0.main.0.W", "Decoder.1.layers.5.main.1.main.0.W", "Decoder.1.layers.5.main_fft.0.main.0.W", "Decoder.1.layers.5.main_fft.1.main.0.W", "Decoder.1.layers.6.main.0.main.0.W", "Decoder.1.layers.6.main.1.main.0.W", "Decoder.1.layers.6.main_fft.0.main.0.W", "Decoder.1.layers.6.main_fft.1.main.0.W", "Decoder.1.layers.7.main.0.main.0.W", "Decoder.1.layers.7.main.1.main.0.W", "Decoder.1.layers.7.main_fft.0.main.0.W", "Decoder.1.layers.7.main_fft.1.main.0.W", "Decoder.2.layers.4.main.0.main.0.W", "Decoder.2.layers.4.main.1.main.0.W", "Decoder.2.layers.4.main_fft.0.main.0.W", "Decoder.2.layers.4.main_fft.1.main.0.W", "Decoder.2.layers.5.main.0.main.0.W", "Decoder.2.layers.5.main.1.main.0.W", "Decoder.2.layers.5.main_fft.0.main.0.W", "Decoder.2.layers.5.main_fft.1.main.0.W", "Decoder.2.layers.6.main.0.main.0.W", "Decoder.2.layers.6.main.1.main.0.W", "Decoder.2.layers.6.main_fft.0.main.0.W", "Decoder.2.layers.6.main_fft.1.main.0.W", "Decoder.2.layers.7.main.0.main.0.W", "Decoder.2.layers.7.main.1.main.0.W", "Decoder.2.layers.7.main_fft.0.main.0.W", "Decoder.2.layers.7.main_fft.1.main.0.W".

INVOKERer commented 3 days ago

是否有完整的报错?如果无法解决可以尝试AAAI23分支