{"action":"created","issue":{"url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/95","repository_url":"https://api.github.com/repos/OpenNMT/OpenNMT-py","labels_url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/95/comments","events_url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/95/events","html_url":"https://github.com/OpenNMT/OpenNMT-py/issues/95","id":240888824,"number":95,"title":"attention mask error during translation","user":{"login":"mattiadg","id":4108706,"avatar_url":"https://avatars3.githubusercontent.com/u/4108706?v=3","gravatar_id":"","url":"https://api.github.com/users/mattiadg","html_url":"https://github.com/mattiadg","followers_url":"https://api.github.com/users/mattiadg/followers","following_url":"https://api.github.com/users/mattiadg/following{/other_user}","gists_url":"https://api.github.com/users/mattiadg/gists{/gist_id}","starred_url":"https://api.github.com/users/mattiadg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattiadg/subscriptions","organizations_url":"https://api.github.com/users/mattiadg/orgs","repos_url":"https://api.github.com/users/mattiadg/repos","events_url":"https://api.github.com/users/mattiadg/events{/privacy}","received_events_url":"https://api.github.com/users/mattiadg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-06T08:59:13Z","updated_at":"2017-07-06T11:51:19Z","closed_at":null,"body":"I have tried to train models with different settings:\r\n```bash\r\npython train.py -log_interval 100 -context_gate both -optim adam -learning_rate 0.0001 -data data/demo.train.pt -epochs=1 -rnn_size 100 -word_vec_size 100 -optim adam -brnn -rnn_type GRU\r\n```\r\n```bash\r\npython train.py -log_interval 100  -optim adam -learning_rate 0.0001 -data data/demo.train.pt -epochs=1 -rnn_size 100 -word_vec_size 100 -optim adam -brnn -rnn_type LSTM -gpus 3\r\n```\r\n```bash\r\npython train.py -log_interval 100 -context_gate both -optim adam -learning_rate 0.0001 -data data/demo.train.pt -epochs=1 -rnn_size 100 -word_vec_size 100 -optim adam  -brnn -rnn_type LSTM -gpus 3\r\n```\r\n\r\nbut then, when I try to translate with \r\n```bash\r\npython translate.py -model model_XXX.pt -src data/src-test.txt -output pred.txt -replace_unk -verbose\r\n```\r\n\r\nI get always the following error\r\n```bash\r\nTraceback (most recent call last):\r\n  File \"translate.py\", line 171, in <module>\r\n    main()\r\n  File \"translate.py\", line 110, in main\r\n    = translator.translate(srcBatch, tgtBatch)\r\n  File \"/hltsrv0/digangi/OpenNMT-py/onmt/Translator.py\", line 250, in translate\r\n    pred, predScore, attn, goldScore = self.translateBatch(batch)\r\n  File \"/hltsrv0/digangi/OpenNMT-py/onmt/Translator.py\", line 164, in translateBatch\r\n    context, decStates)\r\n  File \"/hltsrv0/digangi/bin/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 206, in __call__\r\n    result = self.forward(*input, **kwargs)\r\n  File \"/hltsrv0/digangi/OpenNMT-py/onmt/Models.py\", line 306, in forward\r\n    context.transpose(0, 1))\r\n  File \"/hltsrv0/digangi/bin/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py\", line 206, in __call__\r\n    result = self.forward(*input, **kwargs)\r\n  File \"/hltsrv0/digangi/OpenNMT-py/onmt/modules/GlobalAttention.py\", line 81, in forward\r\n    batch_, sourceL_ = self.mask.size()\r\nValueError: too many values to unpack (expected 2)\r\n```"},"comment":{"url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/comments/313374317","html_url":"https://github.com/OpenNMT/OpenNMT-py/issues/95#issuecomment-313374317","issue_url":"https://api.github.com/repos/OpenNMT/OpenNMT-py/issues/95","id":313374317,"user":{"login":"sebastianGehrmann","id":2212304,"avatar_url":"https://avatars3.githubusercontent.com/u/2212304?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianGehrmann","html_url":"https://github.com/sebastianGehrmann","followers_url":"https://api.github.com/users/sebastianGehrmann/followers","following_url":"https://api.github.com/users/sebastianGehrmann/following{/other_user}","gists_url":"https://api.github.com/users/sebastianGehrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianGehrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianGehrmann/subscriptions","organizations_url":"https://api.github.com/users/sebastianGehrmann/orgs","repos_url":"https://api.github.com/users/sebastianGehrmann/repos","events_url":"https://api.github.com/users/sebastianGehrmann/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianGehrmann/received_events","type":"User","site_admin":false},"created_at":"2017-07-06T11:51:19Z","updated_at":"2017-07-06T11:51:19Z","body":"Sorry, my bad. -  #96 should fix this."}}
{"actor":{"display_login":"sebastianGehrmann"}}