This commit is contained in:
lyuxiang.lx
2025-02-11 15:56:20 +08:00
parent f77c6a85aa
commit 890300513c

View File

@@ -75,7 +75,8 @@ def main():
print('Processing {}'.format(path)) print('Processing {}'.format(path))
states = torch.load(path, map_location=torch.device('cpu')) states = torch.load(path, map_location=torch.device('cpu'))
for k in states.keys(): for k in states.keys():
if k not in avg.keys() and k not in ['step', 'epoch']: if k not in ['step', 'epoch']:
if k not in avg.keys():
avg[k] = states[k].clone() avg[k] = states[k].clone()
else: else:
avg[k] += states[k] avg[k] += states[k]