salesforce / awd-lstm-lm

LSTM and QRNN Language Model Toolkit for PyTorch
BSD 3-Clause "New" or "Revised" License
1.96k stars 488 forks source link

torch.cuda.FloatTensor #117

Closed lmxhappy closed 4 years ago

lmxhappy commented 4 years ago

python main.py --cuda --epochs 750 --data data/wikitext-2 --save WT2.pt --dropouth 0.2 --seed 1882

Traceback (most recent call last): File "main.py", line 245, in train() File "main.py", line 200, in train output, hidden, rnn_hs, dropped_rnn_hs = model(data, hidden, return_h=True) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/home/ubuntu/model.py", line 81, in forward raw_output, new_h = rnn(raw_output, hidden[l]) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, **kwargs) File "/home/ubuntu/weight_drop.py", line 47, in forward self._setweights() File "/home/ubuntu/weight_drop.py", line 44, in _setweights setattr(self.module, name_w, w) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 604, in setattr .format(torch.typename(value), name)) TypeError: cannot assign 'torch.cuda.FloatTensor' as parameter 'weight_hh_l0' (torch.nn.Parameter or None expected)