SrGrace
SrGrace

Reputation: 326

Not able to use fastai's pretrained_model=URLs.WT103

Trying to use fastai's language_model_learner:

learn = language_model_learner(data_lm, pretrained_model=URLs.WT103, drop_mult=0.7)

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-17-811dec5cedeb> in <module>
----> 1 learn = language_model_learner(data_lm, 
pretrained_model=URLs.WT103, drop_mult=0.7)

AttributeError: type object 'URLs' has no attribute 'WT103'

Upvotes: 2

Views: 2292

Answers (3)

Anton Ovchinnikov
Anton Ovchinnikov

Reputation: 21

Seems API has been changed. Try

learn = language_model_learner(data_lm, AWD_LSTM, drop_mult=0.7)

as it's suggested in the official guideline.

More details on the language_model_learner() are here.

Upvotes: 2

CorneliaGao
CorneliaGao

Reputation: 51

Try drop the parameter of pretrained_model, like learn = language_model_learner(data_lm, arch = AWD_LSTM, pretrained = True, drop_mult=0.7) It works fine for me.

Upvotes: 5

dystopian_haze
dystopian_haze

Reputation: 91

I faced the similar issue while i was trying to fine tune the pretrained language model today. It looks like they have changed the data link and instead of using URLs.WT103 you can use URLs.WT103_FWD or URLs.WT103_BWD.

Also add the value for 'arch' parameter as AWD_LSTM and pretrained to True which wil by default use the weights for pretrained WT103_FWD.

Upvotes: 4

Related Questions