1.加载预训练模型: model_path=("./SwinJSCC/SwinJSCC w- SA/SwinJSCC_w_SA_AWGN_HRimage_snr_psnr_C96.model")
load_weights(model_path)
2.给定的命令:--trainset DIV2K --testset kodak --distortion-metric MSE --model SwinJSCC_w/_SA --channel-type awgn --C 96 --multiple-snr 1,4,7,10,13 --model_size base
3.报错缺少权重:Traceback (most recent call last):
File "F:\Paper2\swintranformer2_runbase\main.py", line 348, in
load_weights(model_path)
File "F:\Paper2\swintranformer2_runbase\main.py", line 160, in load_weights
net.load_state_dict(pretrained, strict=True)
File "D:\InstallSoftware\anaconda\envs\bpgan_env_3\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SwinJSCC:
Missing key(s) in state_dict: "encoder.bm_list1.0.fc.0.weight", "encoder.bm_list1.0.fc.0.bias", "encoder.bm_list1.0.fc.2.weight", "encoder.bm_list1.0.fc.2.bias", "encoder.bm_list1.0.fc.4.weight", "encoder.bm_list1.0.fc.4.bias", "encoder.bm_list1.1.fc.0.weight", "encoder.bm_list1.1.fc.0.bias", "encoder.bm_list1.1.fc.2.weight", "encoder.bm_list1.1.fc.2.bias", "encoder.bm_list1.1.fc.4.weight", "encoder.bm_list1.1.fc.4.bias", "encoder.bm_list1.2.fc.0.weight", "encoder.bm_list1.2.fc.0.bias", "encoder.bm_list1.2.fc.2.weight", "encoder.bm_list1.2.fc.2.bias", "encoder.bm_list1.2.fc.4.weight", "encoder.bm_list1.2.fc.4.bias", "encoder.bm_list1.3.fc.0.weight", "encoder.bm_list1.3.fc.0.bias", "encoder.bm_list1.3.fc.2.weight", "encoder.bm_list1.3.fc.2.bias", "encoder.bm_list1.3.fc.4.weight", "encoder.bm_list1.3.fc.4.bias", "encoder.bm_list1.4.fc.0.weight", "encoder.bm_list1.4.fc.0.bias", "encoder.bm_list1.4.fc.2.weight", "encoder.bm_list1.4.fc.2.bias", "encoder.bm_list1.4.fc.4.weight", "encoder.bm_list1.4.fc.4.bias", "encoder.bm_list1.5.fc.0.weight", "encoder.bm_list1.5.fc.0.bias", "encoder.bm_list1.5.fc.2.weight", "encoder.bm_list1.5.fc.2.bias", "encoder.bm_list1.5.fc.4.weight", "encoder.bm_list1.5.fc.4.bias", "encoder.bm_list1.6.fc.0.weight", "encoder.bm_list1.6.fc.0.bias", "encoder.bm_list1.6.fc.2.weight", "encoder.bm_list1.6.fc.2.bias", "encoder.bm_list1.6.fc.4.weight", "encoder.bm_list1.6.fc.4.bias", "encoder.sm_list1.0.weight", "encoder.sm_list1.0.bias", "encoder.sm_list1.1.weight", "encoder.sm_list1.1.bias", "encoder.sm_list1.2.weight", "encoder.sm_list1.2.bias", "encoder.sm_list1.3.weight", "encoder.sm_list1.3.bias", "encoder.sm_list1.4.weight", "encoder.sm_list1.4.bias", "encoder.sm_list1.5.weight", "encoder.sm_list1.5.bias", "encoder.sm_list1.6.weight", "encoder.sm_list1.6.bias", "encoder.sm_list1.7.weight", "encoder.sm_list1.7.bias".
作者,麻烦问一下,为什么会报错呢,实在没找出问题所在,需要帮忙
1.加载预训练模型: model_path=("./SwinJSCC/SwinJSCC w- SA/SwinJSCC_w_SA_AWGN_HRimage_snr_psnr_C96.model")
load_weights(model_path)
2.给定的命令:--trainset DIV2K --testset kodak --distortion-metric MSE --model SwinJSCC_w/_SA --channel-type awgn --C 96 --multiple-snr 1,4,7,10,13 --model_size base
3.报错缺少权重:Traceback (most recent call last):
File "F:\Paper2\swintranformer2_runbase\main.py", line 348, in
load_weights(model_path)
File "F:\Paper2\swintranformer2_runbase\main.py", line 160, in load_weights
net.load_state_dict(pretrained, strict=True)
File "D:\InstallSoftware\anaconda\envs\bpgan_env_3\lib\site-packages\torch\nn\modules\module.py", line 1482, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for SwinJSCC:
Missing key(s) in state_dict: "encoder.bm_list1.0.fc.0.weight", "encoder.bm_list1.0.fc.0.bias", "encoder.bm_list1.0.fc.2.weight", "encoder.bm_list1.0.fc.2.bias", "encoder.bm_list1.0.fc.4.weight", "encoder.bm_list1.0.fc.4.bias", "encoder.bm_list1.1.fc.0.weight", "encoder.bm_list1.1.fc.0.bias", "encoder.bm_list1.1.fc.2.weight", "encoder.bm_list1.1.fc.2.bias", "encoder.bm_list1.1.fc.4.weight", "encoder.bm_list1.1.fc.4.bias", "encoder.bm_list1.2.fc.0.weight", "encoder.bm_list1.2.fc.0.bias", "encoder.bm_list1.2.fc.2.weight", "encoder.bm_list1.2.fc.2.bias", "encoder.bm_list1.2.fc.4.weight", "encoder.bm_list1.2.fc.4.bias", "encoder.bm_list1.3.fc.0.weight", "encoder.bm_list1.3.fc.0.bias", "encoder.bm_list1.3.fc.2.weight", "encoder.bm_list1.3.fc.2.bias", "encoder.bm_list1.3.fc.4.weight", "encoder.bm_list1.3.fc.4.bias", "encoder.bm_list1.4.fc.0.weight", "encoder.bm_list1.4.fc.0.bias", "encoder.bm_list1.4.fc.2.weight", "encoder.bm_list1.4.fc.2.bias", "encoder.bm_list1.4.fc.4.weight", "encoder.bm_list1.4.fc.4.bias", "encoder.bm_list1.5.fc.0.weight", "encoder.bm_list1.5.fc.0.bias", "encoder.bm_list1.5.fc.2.weight", "encoder.bm_list1.5.fc.2.bias", "encoder.bm_list1.5.fc.4.weight", "encoder.bm_list1.5.fc.4.bias", "encoder.bm_list1.6.fc.0.weight", "encoder.bm_list1.6.fc.0.bias", "encoder.bm_list1.6.fc.2.weight", "encoder.bm_list1.6.fc.2.bias", "encoder.bm_list1.6.fc.4.weight", "encoder.bm_list1.6.fc.4.bias", "encoder.sm_list1.0.weight", "encoder.sm_list1.0.bias", "encoder.sm_list1.1.weight", "encoder.sm_list1.1.bias", "encoder.sm_list1.2.weight", "encoder.sm_list1.2.bias", "encoder.sm_list1.3.weight", "encoder.sm_list1.3.bias", "encoder.sm_list1.4.weight", "encoder.sm_list1.4.bias", "encoder.sm_list1.5.weight", "encoder.sm_list1.5.bias", "encoder.sm_list1.6.weight", "encoder.sm_list1.6.bias", "encoder.sm_list1.7.weight", "encoder.sm_list1.7.bias".
作者,麻烦问一下,为什么会报错呢,实在没找出问题所在,需要帮忙