You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error is not due to exporting the learner. I verified it. There is something wrong in learn.tta(). If you run learn.tta() before exporting then the code will still fail with the same error.
UPDATE: The error occurs when we run learn.tta multiple times. When I first ran learn.tta it worked as it should. But when I ran it again learn.tta I got the above error.
learn.epoch = 0 solves the issue. I think the reason is in MasterBar.updatestart_t is only defined when val=0 i.e. epoch=0.
Please confirm you have the latest versions of fastai, fastcore, fastscript, and nbdev prior to reporting a bug (delete one): YES
Describe the bug
learn.tta() fails on a learner which is imported with load_learner()
To Reproduce
Colab notebook reproducing the behaivor at https://colab.research.google.com/drive/1l1tnOtboOwOhsYjwi8K8cUEPIPpDJMaU?usp=sharing
Steps to reproduce the behavior:
tst_dl=learn.dls.test_dl(get_image_files(path))
preds, targs = learn.tta(dl=tst_dl)
This runs without error. (However
targs
returnsNone
which is not expected)The error arises from exporting the learner and then loading. After step 1 above
learn.export('/content/learnfile.pkl')
in_learn=load_learner('/content/learnfile.pkl')
tst_dl=in_learn.dls.test_dl(get_image_files(path))
.tta()
now produces an error.preds, targs = in_learn.tta(dl=tst_dl)
Expected behavior
.tta()
should work on the loaded learner exactly as it did on the learner which was just trained.Error with full stack trace
Additional context
Running on Google colab
The text was updated successfully, but these errors were encountered: