harvardnlp / seq2seq-attn

Sequence-to-sequence model with LSTM encoder/decoders and attention
http://nlp.seas.harvard.edu/code
MIT License
1.26k stars 278 forks source link

0d source #62

Closed mzhai2 closed 7 years ago

mzhai2 commented 8 years ago

Hey Yoon, I'm trying out your model for some tasks and its working great!

SENT 1639: /home/work/torch/install/bin/luajit: ./s2sa/beam.lua:131: bad argument #1 to 'size' (dimension 1 out of range of 0D tensor at /home/work/torch/pkg/torch/generic/Tensor.c:19) stack traceback: [C]: in function 'size' ./s2sa/beam.lua:131: in function 'generate_beam' ./s2sa/beam.lua:770: in function 'search' evaluate.lua:12: in function 'main' evaluate.lua:30: in main chunk [C]: in function 'dofile' ...work/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00405d50

Setting source_l to 0 doesn't fix it as the 0d source will get a view later. I don't know if it makes a difference but I'm using your defaults + score gold For now I'm just outputting an empty table for max_hyp if source:dim() == 0 so it passes that example.

Also using 2 gpu's fails on beam. I get this issue: https://github.com/torch/cutorch/issues/434 Adding cutorch.setKernelPeerToPeerAccess(true) fixes it.

yoonkim commented 8 years ago

hey mike good to hear from you. yeah i guess there should be a check to make sure that source is nonempty when reading. ill look into adding this check