一.分布式训练load模型时报错与网络参数匹配不一致的问题:
问题1:模型并非分布式模型,但是load保存的模型有.module参数
解决:
new_state_dict = {}
state_dict = checkpoint['state_dict']
for k, v in state_dict.items():
name = k[7:] # 去除前面的 ".module"
new_state_dict[name] = v
model.load_state_dict(new_state_dict)
一.分布式训练load模型时报错与网络参数匹配不一致的问题:
问题1:模型并非分布式模型,但是lo