resume option not working
gjkaur opened this issue · 3 comments
<bound method EDiceLoss.metric of EDiceLoss()>
Ranger optimizer loaded.
Gradient Centralization usage = True
GC applied to both conv and fc layers
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/drive/My Drive/lescientifik/open_brats2020/train.py", line 468, in
main(arguments)
File "/content/drive/My Drive/lescientifik/open_brats2020/train.py", line 166, in main
reload_ckpt(args, model, optimizer)
TypeError: reload_ckpt() missing 1 required positional argument: 'scheduler'
!python -m train --devices 0 --width 48 --resume /content/drive/MyDrive/lescientifik/open_brats2020/runs/20210521_075846__fold0_EquiUnet_48_batch1_optimranger_ranger_lr0.0001-wd0.0_epochs200_deepsupFalse_fp16_warm0__normgroup_dropout0.0_warm_restartFalse/model_best.pth.tar --arch EquiUnet
Indeed, it's an option i had in fact never used... If you are willing to submit a pull request I would be glad to accept it thx!
I think I have gotten this to work :
Just change the portion in train code to such :
if args.resume:
#reload_ckpt(args, model, optimizer) Remove this line as this causes an issue due to the usage of
#model_state_dict key error
checkpoint = torch.load(args.resume)
model.load_state_dict(checkpoint['state_dict'])
If this is ok, I can submit the pull request, thanks!