While working on the Arabic ULMFiT model, I encountered the above error in convert_weights_with_prefix. How can I initialize these:
dec_bias, enc_wgts = wgts[prefix+'1.decoder.bias'], wgts[prefix+'0.encoder.weight']
fastai version : 1.0.32
torch version : 1.0.0.dev20181202
...
line 81, in convert_weights_with_prefix
dec_bias, enc_wgts = wgts[prefix+'1.decoder.bias'], wgts[prefix+'0.encoder.weight']
KeyError: '1.decoder.bias'
The same error occurs if I try the text ex at https://docs.fast.ai/text.html using my generated model (using machine translation of around 1000 imdb texts)
/usr/local/lib/python3.6/dist-packages/fastai/text/learner.py in convert_weights(wgts, stoi_wgts, itos_new)
18 def convert_weights(wgts:Weights, stoi_wgts:Dict[str,int], itos_new:Collection[str]) -> Weights:
19 "Convert the model `wgts` to go with a new vocabulary."
---> 20 dec_bias, enc_wgts = wgts['1.decoder.bias'], wgts['0.encoder.weight']
21 bias_m, wgts_m = dec_bias.mean(0), enc_wgts.mean(0)
22 new_w = enc_wgts.new_zeros((len(itos_new),enc_wgts.size(1))).zero_()