RUCAIBox/TextBox

Bug report

Dai-Wenxun opened this issue · 3 comments

When I run python run_textbox.py --rnn_type=lstm --max_vocab_size=4000, I found a bug in the textbox/module/Decoder/rnn_decoder.py, which occurred on line 78. The init_hidden() function returns a tuple when initialzed with lstm so got AttributeError: 'tuple' object has no attribute 'contiguous'.

Sorry, I cannot reproduce your problem. Could you provide the PyTorch version?

When I run the code, mi version is torch-1.9.1+cpu py-3.8.5. Following the readme, I set up a new environment with torch-1.6.0+gpu py-3.8.11. The error occurred again. From my perspective, it's not the problem about torch version but the error that the tuple object indeed doesn't have the method - contiguous().

I have fixed it and you can pull the latest one. Thanks for your report.