Char-RNN-PyTorch icon indicating copy to clipboard operation
Char-RNN-PyTorch copied to clipboard

gru单元出错

Open LuciferTian opened this issue 5 years ago • 6 comments

运行到score, _ = model(x)时,出错,不知道是什么原因呢?TypeError: gru() received an invalid combination of arguments - got (Tensor, Tensor, list, float, int, float, bool, bool, bool), but expected one of:

  • (Tensor data, Tensor batch_sizes, Tensor hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional) didn't match because some of the arguments have invalid types: (Tensor, Tensor, list, float, int, float, bool, bool, bool)
  • (Tensor input, Tensor hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first) didn't match because some of the arguments have invalid types: (Tensor, Tensor, list, float, int, float, bool, bool, bool)

LuciferTian avatar Sep 05 '19 13:09 LuciferTian

Same error!

ArnoldIOI avatar Sep 24 '19 02:09 ArnoldIOI

self.rnn = nn.GRU(embed_dim, hidden_size, num_layers, dropout) ,把droupout去掉就行了。

lushunn avatar Nov 28 '19 07:11 lushunn

can refer https://github.com/xiadingZ/video-caption.pytorch/issues/32

zl535320706 avatar Dec 12 '19 07:12 zl535320706