加载训练后的模型时modulated.weight权重参数不对应;The weight parameter modulated.weight does not correspond when loading the trained model #434

Open
opened 2026-01-29 21:47:42 +00:00 by claunia · 0 comments
Owner

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))
请问是什么原因导致的呢?多谢

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)) 请问是什么原因导致的呢?多谢
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#434