I am running out of memory when using interp = ClassificationInterpretation.from_learner(learn)
As suggested by Sylvain, I would like to generate a partial subset of the validation set in order to run the previous command. Tried something like:
interp = ClassificationInterpretation.from_learner(learn, slice(dls.valid_ds[int(1):int(1000)]))
But I got an error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-49-e87882ae4fd1> in <module>
----> 1 interp = ClassificationInterpretation.from_learner(learn, slice(dls.valid_ds[int(1):int(1000)]))
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/interpret.py in from_learner(cls, learn, ds_idx, dl, act)
23 def from_learner(cls, learn, ds_idx=1, dl=None, act=None):
24 "Construct interpretatio object from a learner"
---> 25 if dl is None: dl = learn.dls[ds_idx]
26 return cls(dl, *learn.get_preds(dl=dl, with_input=True, with_loss=True, with_decoded=True, act=None))
27
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in __getitem__(self, i)
121 self.device = device
122
--> 123 def __getitem__(self, i): return self.loaders[i]
124 def new_empty(self):
125 loaders = [dl.new(dl.dataset.new_empty()) for dl in self.loaders]
TypeError: slice indices must be integers or None or have an __index__ method
Any idea how to generate this subset? Thanks!