xiadingZ / video-caption.pytorch

pytorch implementation of video captioning
MIT License
401 stars 130 forks source link

A bug: TypeError: gru() received an invalid combination of arguments - got (Tensor, Tensor, list, bool, int, float, bool, int, bool), but expected one of: #32

Closed tuyunbin closed 5 years ago

tuyunbin commented 5 years ago

Problem My python version is 2.7(but this bug also exist when using python3+), and pytorch version is 1.1.0 TypeError: gru() received an invalid combination of arguments - got (Tensor, Tensor, list, bool, int, float, bool, int, 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!, !bool!, !int!, !float!, !bool!, !int!, 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!, bool, int, float, bool, !int!, bool) Solution: change bidirectional=opt["bidirectional"] to bidirectional=bool(opt["bidirectional"])

piperino11 commented 5 years ago

Solution: change bidirectional=opt["bidirectional"] to bidirectional=bool(opt["bidirectional"]) in which file?

zl535320706 commented 4 years ago

Solution: change bidirectional=opt["bidirectional"] to bidirectional=bool(opt["bidirectional"]) in which file?

not in a file , in def init, define your self.rnn(...bidirectional=bool(bidirectional))