Unfortunately after swapping it complains about missing set_stat:
‘’’~/anaconda3/lib/python3.7/site-packages/fastai/callbacks/general_sched.py in on_train_begin(self, epoch, **kwargs)
30 for k,v in self.scheds[0].items():
31 v.restart()
—> 32 self.opt.set_stat(k, v.start)
33 self.idx_s = 0
34 return res
AttributeError: type object ‘AdamW’ has no attribute ‘set_stat’
‘’’
saving with_opt=False and then reloading doesn’t work either…you end up with a model that will not run as no matter what optimizer you piont it to, ,you get the issue with no set_stat attribute…
You can change optimizers. It looks like you are try to use a PyTorch one though, which needs to be wrapped inside a class to work with fastai2 (Adam in v2 is AdamW by the way). The best way to do this would be