awd-lstm-lm
awd-lstm-lm copied to clipboard
How-to generate after training word level qrnn?
After training using Word level WikiText-103 (PTB) with QRNN
Try to finetune:
File "finetune.py", line 107, in evaluate
if args.model == 'QRNN': model.reset()
AttributeError: 'list' object has no attribute 'reset'
Try to generate:
File "generate.py", line 51, in <module>
model.eval()
AttributeError: 'list' object has no attribute 'eval'
All help appreciated.
Note: i'm using my own corpus ... but suspect tht shouldn't matter. And I've generated many times before using the previous code. So am wondering if current process is incompatible with generate.py I'd love to try the new faster version as detailed in your research paper.
The generate.py
script is broken: you should change line model = torch.load(f)
to model, _, _ = torch.load(f)
because in the pickle object there are actually model **and ** optimizer and loss function.