Out of memory error Kaggle

I trained an image classification model using resnet18 for baseline on Kaggle. I’m trying to plot the confusion matrix as follows:

interp = ClassificationInterpretation.from_learner(learn)
interp.plot_confusion_matrix(figsize=(12,12), dpi=60)

and it says kernel out of memory and restarts. Am I doing something wrong or is it because of Kaggle’s restriction on resources?

The dataset has 190482 images.

I’m facing the same error. Is there any updates on this topic?