Ideally we’d put this in 2 PR’s, one to Interp notebook and py and one to the widgets notebook and py. Jeremy likes incremental PR’s Haven’t checked on the ImageCleaner yet to see if that can be adjusted at all, should be able to review that in the next day or two
Also I’ve only tested this on images. We need to test this out on all supported applications to make sure it works in all scenarios
Ok, my fixes above seem to work for everything for which an Interpretation class is implemented (e.g. plot_top_losses not implemented for segmentation or image regression). Tabular definitely works though.
@muellerzr How is your improved Interpretation class looking?
I made a PR for ImageClassifierCleaner as you suggested to keep them separate, and it is a fix that shouldn’t have any deeper consequences. I’ll leave the Interpretation class fixes to you as you’re clearly doing more major surgery.
Hello @muellerzr .
The memory inefficiency is still exist on the fastai version released three days ago (2.5.0). When I try to predict a dataset with 500K samples using tabular model, the 128G system RAM gets full after 74% of prediction and the computer freezes. The prediction works using 200K samples. I noticed that the class Interpretation on the current version of fastai is not using the getitem() strategy proposed here…
When I copy the class interpretation proposed here to the library, and run the interp = ClassificationInterpretation.from_learner(learn), I got the following error:
“TypeError: init() missing 1 required positional argument: ‘losses’”
Hope you can help address this issue…
BR
They passed all the tests I did at the time, but @muellerzr was worried about their generality so I never did a formal PR for them. So there’s a good chance these will work for whatever your application is, and if they don’t work, please let us know!
@hushitz , Appreciate your suggestion. I run it, however, the memory inefficiency is still occurring.
Actually, a couple of weeks ago, I achieved some improvement after trying the codes proposed here. Initially, I could execute the prediction using a dataset having 200k samples. After trying both codes, one at a time while installing different versions of fastai library, I managed to run prediction on 500k samples. The issue is that the environment was accidentally deleted, and unfortunately, I didn’t backup it neither noted what code worked. Please let me know if you need additional information for further investigation.
BR