__init__() got an unexpected keyword argument 'classes' when running TextClasDataBunch. Fast ai version: '1.0.42'

Hello,

I have trying to to Fine tune my model.

But I am getting the following error when I am running the following command on jupyter notebook:

data_clas = TextClasDataBunch.from_df('./', train_df=df_trn, valid_df=df_val, 
vocab=data_lm.train_ds.vocab, bs=32)

Error:
init() got an unexpected keyword argument ‘classes’

I am able to run the TextClasDataBunch on Google colab. But I get this issue when running on Jupyter notebook

Fast ai version: ‘1.0.42’
Torch Version: 1.0.1.post2
Please help

Regards,
Jerry

1 Like

I had the same issue. The way to fix is to add labels, even some mock-up ones as np.zeros. However, it was a case with TextDataBunch.from_ids