File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
references/classification Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,8 @@ def main(args):
325
325
args .start_epoch = checkpoint ["epoch" ] + 1
326
326
if model_ema :
327
327
model_ema .load_state_dict (checkpoint ["model_ema" ])
328
+ if scaler :
329
+ scaler .load_state_dict (checkpoint ["scaler" ])
328
330
329
331
if args .test_only :
330
332
# We disable the cudnn benchmarking because it can noticeably affect the accuracy
@@ -356,6 +358,8 @@ def main(args):
356
358
}
357
359
if model_ema :
358
360
checkpoint ["model_ema" ] = model_ema .state_dict ()
361
+ if scaler :
362
+ checkpoint ["scaler" ] = scaler .state_dict ()
359
363
utils .save_on_master (checkpoint , os .path .join (args .output_dir , f"model_{ epoch } .pth" ))
360
364
utils .save_on_master (checkpoint , os .path .join (args .output_dir , "checkpoint.pth" ))
361
365
You can’t perform that action at this time.
0 commit comments