Closed yangtzech closed 1 year ago
Hi @yangtzech , I've been able to replicate this issue. It comes from fastai. The ShowGraph code uses fastai's ShowGraphCallback as a basis. But the original design seems to not have taken into account the start_epoch option. You can actually reproduce the same issue if you replace ShowGraph with ShowGraphCallback. It'd be good if you would create an issue in the fastai repo.
Sorry, I thought ShowGraph caused it. I'll create an issue in fastai.
@yangtzech, No problem. You could use a pure fastai code snippet like this to reproduce the issue:
from fastai.test_utils import *
cbs = [ShowGraphCallback(),
SaveModel(monitor='valid_loss', every_epoch=True, with_opt=True)]
learn = synth_learner(cbs=cbs)
learn.fit(50)
Stop at iteration 10 for any reason. Then do:
learn = learn.load('model_10')
learn.fit_one_cycle(50, start_epoch=11)
Define a leaner
train for some epochs
then interrupts it at epoch 9.
load the previous epoch saved model again
resume training by setting start_epoch
error occurs:
No error if deleting
ShowGraphCallback2()
before loading the learner from the previous epoch.