You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please confirm you have the latest versions of fastai, fastcore, and nbdev prior to reporting a bug (delete one): YES
Describe the bug
The function get_text_classifier from the module text.models.core which takes the argument arch (eg AWD_LSTM) throws a KeyError when a user-instantiated AWD_LSTM is passed (AWD_LSTM(vocab_sz=100, emb_sz=10, n_hid=2, n_layers=2) ).
More precisely, the lookup _model_meta[arch] fails because the custom AWS_LSTM instance is not recognized as being equal to <class 'fastai.text.models.awdlstm.AWD_LSTM'> (the key of the _model_meta[arch] dictionary).
You need to modify the way you used the API, according to docs arch need to be a class or callable creating a model (not the model itself as you gave). something like:
The second problem is the API itself. I don't like the part that I created config config = awd_lstm_clas_config.copy() and the next line. I'm going to create PR to solve this issue, so you can use the API like:
Please confirm you have the latest versions of fastai, fastcore, and nbdev prior to reporting a bug (delete one): YES
Describe the bug
The function
get_text_classifier
from the moduletext.models.core
which takes the argumentarch
(egAWD_LSTM
) throws aKeyError
when a user-instantiatedAWD_LSTM
is passed (AWD_LSTM(vocab_sz=100, emb_sz=10, n_hid=2, n_layers=2)
).More precisely, the lookup
_model_meta[arch]
fails because the customAWS_LSTM
instance is not recognized as being equal to<class 'fastai.text.models.awdlstm.AWD_LSTM'>
(the key of the_model_meta[arch]
dictionary).To Reproduce
Steps to reproduce the behavior:
The error can be clearly seen in this notebook, which can be directly accessed in colab here
Expected behavior
Function should return a
SequentialRNN
instance.Error with full stack trace
Additional context
Forum discussion with another report from @machinatoonist (with no solution so far): https://forums.fast.ai/t/how-to-customise-vocab-sz-in-text-classifier-learner/98230.
The text was updated successfully, but these errors were encountered: