wenyu1009 / RTSRN

MIT License
17 stars 2 forks source link

RuntimeError: Error(s) in loading state_dict for DataParallel: #8

Open Konmore opened 6 months ago

Konmore commented 6 months ago

我在复现代码时遇到了这个问题 RuntimeError: Error(s) in loading state_dict for DataParallel: Missing key(s) in state_dict: "module.embedding_word.lut.weight", "module.pe.pe", "module.encoder.cnn.conv1.weight", "module.encoder.cnn.conv1.bias", "module.encoder.cnn.bn1.weight", "module.encoder.cnn.bn1.bias", "m 请问该怎么解决呢,我使用的是单GPU,谢谢

wenyu1009 commented 6 months ago

这个问题可能是单卡加载在多卡上训练的模型导致的。需要debug定位下是哪个模型加载出现问题,随后在加载时写个代码将module 去掉。

Konmore commented 4 months ago

感谢您的回答,上述问题我已经解决了,但是在训练时,控制台一直打印下面两行: embed:torch.Size([26, 48, 512]) output:torch.Size([48, 26, 512]) 我找不到这两行print在哪里,请问一下这个是在源码中的哪里打印的呢,谢谢

wenyu1009 commented 4 months ago

可以尝试全局搜索print,我也忘记了 ---- Replied Message ---- @.>Date07/18/2024 11:33 @.> @.>, @.>SubjectRe: [wenyu1009/RTSRN] RuntimeError: Error(s) in loading state_dict for DataParallel: (Issue #8) 感谢您的回答,上述问题我已经解决了,但是在训练时,控制台一直打印下面两行: embed:torch.Size([26, 48, 512]) output:torch.Size([48, 26, 512]) 我找不到这两行print在哪里,请问一下这个是在源码中的哪里打印的呢,谢谢 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>