/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.py:46: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.5 and num_layers=1
  "num_layers={}".format(dropout, num_layers))
Traceback (most recent call last):
  File "lstm.py", line 647, in <module>
    words_embs, sent_emb = text_encoder(captions, cap_lens, hidden)
  File "/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "lstm.py", line 87, in forward
    output, hidden = self.rnn(emb, hidden)
  File "/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.py", line 175, in forward
    self.check_forward_args(input, hx, batch_sizes)
  File "/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.py", line 152, in check_forward_args
    'Expected hidden[0] size {}, got {}')
  File "/Users/user/anaconda2/lib/python2.7/site-packages/torch/nn/modules/rnn.py", line 148, in check_hidden_size
    raise RuntimeError(msg.format(expected_hidden_size, tuple(hx.size())))
RuntimeError: Expected hidden[0] size (1, 48, 128), got (48, 128)