awd-lstm-lm icon indicating copy to clipboard operation
awd-lstm-lm copied to clipboard

How-to generate after training word level qrnn?

Open jhave opened this issue 6 years ago • 2 comments

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.

jhave avatar Apr 13 '18 11:04 jhave

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.

jhave avatar Apr 16 '18 15:04 jhave

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.

mojesty avatar May 21 '18 20:05 mojesty