Hello everyone,
After going throug the lesson 2 notebook, I trained my own model to try to reinforce the material. I trained and saved the model, and loaded the model, but I am getting an error when I try to create a ClassificationInterpretation object. I am able to do classifications with the model, so I know it loaded properly. I also tried calling validate on the learner (inf_learner.validate(dl=inf_learner.dls.valid)
, Result: (#2) [None,None]
), but it did not change the error.
I also tried recreating the data loader (same seed, same data), and then doing this::
classification_interpretation = ClassificationInterpretation.from_learner(inf_learner, dl=dog_data_loader.valid)
, which resulted in AssertionError: ==: 1 64
Any help would be greatly appreciated
Thank you.
Code/Error:
inf_learner = load_learner(path/model_name)
classification_interpretation = ClassificationInterpretation.from_learner(inf_learner)
Error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-39-b56c6e7dab63> in <module>
----> 1 classification_interpretation = ClassificationInterpretation.from_learner(inf_learner)
/opt/conda/envs/fastai/lib/python3.8/site-packages/fastai/interpret.py in from_learner(cls, learn, ds_idx, dl, act)
27 "Construct interpretation object from a learner"
28 if dl is None: dl = learn.dls[ds_idx]
---> 29 return cls(dl, *learn.get_preds(dl=dl, with_input=True, with_loss=True, with_decoded=True, act=None))
30
31 def top_losses(self, k=None, largest=True):
TypeError: __init__() missing 1 required positional argument: 'losses'