I’m following along with the fastai book. I encountered an error plotting the confusion matrix in chapter 2.
After training the learner for the first time I run the following code:
interp = ClassificationInterpretation.from_learner(learner)
learner.plot_confusion_matrix()
But I get the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-15-5ed97f736e90> in <cell line: 2>()
1 interp = ClassificationInterpretation.from_learner(learner)
----> 2 learner.plot_confusion_matrix()
1 frames
/usr/local/lib/python3.9/dist-packages/torch/nn/modules/module.py in __getattr__(self, name)
1612 if name in modules:
1613 return modules[name]
-> 1614 raise AttributeError("'{}' object has no attribute '{}'".format(
1615 type(self).__name__, name))
1616
AttributeError: 'Sequential' object has no attribute 'plot_confusion_matrix'
You can see the complete notebook here:
Any ideas why this might be the case? I’m using Google Colab with the latest version of fastai (2.7.12).