mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-04-26 07:42:02 +00:00
加载训练后的模型时modulated.weight权重参数不对应;The weight parameter modulated.weight does not correspond when loading the trained model #434
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liulipeng0538 on GitHub (Jan 26, 2024).
作者团队你们好:我编写简单的训练模型通过 torch.save(module.state_dict()) 保存模型后进行加载发现 stylegan_decoder.style_conv1.modulated_conv.weight等网络层的权重参数与保存参数存在差异,定位是只要涉及modulated_conv.weight都有差异,看源代码中的self.weight = nn.Parameter(
torch.rand(1, out_channels, in_channels, kernel_size, kernel_size) /math.sqrt(in_channels * kernel_size**2))
请问是什么原因导致的呢?多谢