GeoVectorMatrix / Dif-Fusion

Codes for the Dif-Fusion model
96 stars 4 forks source link

我在运行t_fusion.py时遇到了这个问题 #26

Closed wowwowya closed 1 month ago

wowwowya commented 1 month ago

24-10-30 10:57:20.926 - INFO: Model [DDPM] is created. 24-10-30 10:57:20.926 - INFO: Initial Diffusion Model Finished 24-10-30 10:57:21.091 - INFO: Loading pretrained model for Fusion head model [./DIF_Trained/diffusion.pth] ... E:\Diffusion\Dif-Fusion-main\models\Fusion_model.py:172: 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 futu re 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 t his 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. network.load_state_dict(torch.load( Traceback (most recent call last): File "t_fusion.py", line 68, in fussion_net = Model.create_fusion_model(opt) File "E:\Diffusion\Dif-Fusion-main\models__init__.py", line 14, in create_fusion_model m = M(opt) File "E:\Diffusion\Dif-Fusion-main\models\Fusion_model.py", line 45, in init self.load_network() File "E:\Diffusion\Dif-Fusion-main\models\Fusion_model.py", line 172, in load_network network.load_state_dict(torch.load( File "D:\AAnaconda\envs\diffusion\lib\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 Fusion_Head: Missing key(s) in state_dict: "decoder.0.block.0.weight", "decoder.0.block.0.bias", "decoder.0.block.2.weight", "decoder.0.block.2.bias", "decoder.1.block.0.weight", "decoder.1.block.0.bias", "decod er.1.block.2.cSE.fc1.weight", "decoder.1.block.2.cSE.fc1.bias", "decoder.1.block.2.cSE.fc2.weight", "decoder.1.block.2.cSE.fc2.bias", "decoder.1.block.2.sSE.conv.weight", "decoder.1.block.2.sSE.conv.bias", "decoder.2.block.0.weight", "decoder.2.block.0.bias", "decoder.2.block.2.weight", "decoder.2.block.2.bias", "decoder.3.block.0.weight", "decoder.3.block.0.bias", "decoder.3.block.2.cSE.fc1.weight", "decoder .3.block.2.cSE.fc1.bias", "decoder.3.block.2.cSE.fc2.weight", "decoder.3.block.2.cSE.fc2.bias", "decoder.3.block.2.sSE.conv.weight", "decoder.3.block.2.sSE.conv.bias", "decoder.4.block.0.weight", "decoder.4 .block.0.bias", "decoder.4.block.2.weight", "decoder.4.block.2.bias", "decoder.5.block.0.weight", "decoder.5.block.0.bias", "decoder.5.block.2.cSE.fc1.weight", "decoder.5.block.2.cSE.fc1.bias", "decoder.5.b lock.2.cSE.fc2.weight", "decoder.5.block.2.cSE.fc2.bias", "decoder.5.block.2.sSE.conv.weight", "decoder.5.block.2.sSE.conv.bias", "decoder.6.block.0.weight", "decoder.6.block.0.bias", "decoder.6.block.2.wei ght", "decoder.6.block.2.bias", "decoder.7.block.0.weight", "decoder.7.block.0.bias", "decoder.7.block.2.cSE.fc1.weight", "decoder.7.block.2.cSE.fc1.bias", "decoder.7.block.2.cSE.fc2.weight", "decoder.7.blo ck.2.cSE.fc2.bias", "decoder.7.block.2.sSE.conv.weight", "decoder.7.block.2.sSE.conv.bias", "decoder.8.block.0.weight", "decoder.8.block.0.bias", "decoder.8.block.2.weight", "decoder.8.block.2.bias", "rgb_decode2.conv.weight", "rgb_decode2.conv.bias", "rgb_decode1.conv.weight", "rgb_decode1.conv.bias". Unexpected key(s) in state_dict: "betas", "alphas_cumprod", "alphas_cumprod_prev", "sqrt_alphas_cumprod", "sqrt_one_minus_alphas_cumprod", "log_one_minus_alphas_cumprod", "sqrt_recip_alphas_cumprod" , "sqrt_recipm1_alphas_cumprod", "posterior_variance", "posterior_log_variance_clipped", "posterior_mean_coef1", "posterior_mean_coef2", "denoise_fn.noise_level_mlp.1.weight", "denoise_fn.noise_level_mlp.1. bias", "denoise_fn.noise_level_mlp.3.weight", "denoise_fn.noise_level_mlp.3.bias", "denoise_fn.init_conv.weight", "denoise_fn.init_conv.bias", "denoise_fn.downs.0.res_block.noise_func.noise_func.0.weight", "denoise_fn.downs.0.res_block.noise_func.noise_func.0.bias", "denoise_fn.downs.0.res_block.block1.block.0.weight", "denoise_fn.downs.0.res_block.block1.block.0.bias", "denoise_fn.downs.0.res_block.block1.bl ock.3.weight", "denoise_fn.downs.0.res_block.block1.block.3.bias", "denoise_fn.downs.0.res_block.block2.block.0.weight", "denoise_fn.downs.0.res_block.block2.block.0.bias", "denoise_fn.downs.0.res_block.blo ck2.block.3.weight", "denoise_fn.downs.0.res_block.block2.block.3.bias", "denoise_fn.downs.1.res_block.noise_func.noise_func.0.weight", "denoise_fn.downs.1.res_block.noise_func.noisefunc.0.bias", "denoise fn.downs.1.res_block.block1.block.0.weight", "denoise_fn.downs.1.res_block.block1.block.0.bias", "denoise_fn.downs.1.res_block.block1.block.3.weight", "denoise_fn.downs.1.res_block.block1.block.3.bias", "de noise_fn.downs.1.res_block.block2.block.0.weight", "denoise_fn.downs.1.res_block.block2.block.0.bias", "denoise_fn.downs.1.res_block.block2.block.3.weight", "denoise_fn.downs.1.res_block.block2.block.3.bias ", "denoise_fn.downs.2.conv.weight", "denoise_fn.downs.2.conv.bias", "denoise_fn.downs.3.res_block.noise_func.noise_func.0.weight", "denoise_fn.downs.3.res_block.noise_func.noise_func.0.bias", "denoise_fn.d owns.3.res_block.block1.block.0.weight", "denoise_fn.downs.3.res_block.block1.block.0.bias", "denoise_fn.downs.3.res_block.block1.block.3.weight", "denoise_fn.downs.3.res_block.block1.block.3.bias", "denois e_fn.downs.3.res_block.block2.block.0.weight", "denoise_fn.downs.3.res_block.block2.block.0.bias", "denoise_fn.downs.3.res_block.block2.block.3.weight", "denoise_fn.downs.3.res_block.block2.block.3.bias", " denoise_fn.downs.3.res_block.res_conv.weight", "denoise_fn.downs.3.res_block.res_conv.bias", "denoise_fn.downs.4.res_block.noise_func.noise_func.0.weight", "denoise_fn.downs.4.res_block.noise_func.noise_fun c.0.bias", "denoise_fn.downs.4.res_block.block1.block.0.weight", "denoise_fn.downs.4.res_block.block1.block.0.bias", "d

wowwowya commented 1 month ago

请问您能具体说明权重文件的放置位置吗