fastai 'TextDataLoaders' is not defined error

Viewed 171

I run this on locally on jupyter notebook, I didn't get any error, but while running the same code on Google Colab I got the error

Code >

from fastai.text.data import *
dls_lm = TextDataLoaders.from_df(train_df, path=path, is_lm= True, valid_pct=0.1, bs=128)

Error >


NameError Traceback (most recent call last) <ipython-input-19-6b25f76bb852> in <module>() ----> 1 dls_lm = TextDataLoaders.from_df(train_df, path=path, is_lm= True, valid_pct=0.1, bs=128)

NameError: name 'TextDataLoaders' is not defined

LocalColab

1 Answers

You can import like this to make it work.

from fastai.text.data import TextDataLoaders
Related