Language_model_learner() `VauleError: can't optimize a non-leaf Tensor`

Following the tutorial about text model on fastai V1, instead of fine tuning the WT103_1 model, I’d like to create a new model and train it from scratch. But I got the error: VauleError: can't optimize a non-leaf Tensor. The code is as follows:

path = untar_data(URLs.IMDB_SAMPLE)

data_lm = TextLMDataBunch.from_csv(path, ‘texts.csv’)

learn = language_model_learner(data_lm, drop_mult=0.5) (caused the error)

After updating the fastai version from 1.0.39 -> 1.0.40, the bug is fixed.