Yes, I got exactly the same error following the first notebook from the fastai course and trying to train data on IMDb reviews. It’s the code from 01_intro.ipynb:
learn = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=error_rate)
learn.fine_tune(4, 1e-2)
epoch train_loss valid_loss error_rate time
0 0.785647 00:00
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-f3e4bf6dc0bf> in <module>()
1 learn = text_classifier_learner(dls1, AWD_LSTM, drop_mult=0.5, metrics=error_rate)
----> 2 learn.fine_tune(4, 1e-2)
20 frames
/usr/local/lib/python3.6/dist-packages/fastai/callback/rnn.py in after_loss(self)
31 def after_loss(self):
32 if not self.training: return
---> 33 if self.alpha != 0.: self.learn.loss += self.alpha * self.out.float().pow(2).mean()
34 if self.beta != 0.:
35 h = self.raw_out
TypeError: unsupported operand type(s) for +=: 'TensorCategory' and 'TensorText'