C:\ProgramData\Anaconda3\envs\torch\python.exe E:/hyx/seq2seq-master/seq2seq.py train
C:\ProgramData\Anaconda3\envs\torch\lib\site-packages\torch\nn\modules\rnn.py:54: 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.05 and num_layers=1
"num_layers={}".format(dropout, num_layers))
Error(s) in loading state_dict for seq2seq:
size mismatch for encoder.embedding.weight: copying a param with shape torch.Size([600, 100]) from checkpoint, the shape in current model is torch.Size([14, 100]).
size mismatch for decoder.embedding.weight: copying a param with shape torch.Size([1600, 100]) from checkpoint, the shape in current model is torch.Size([15, 100]).
size mismatch for decoder.out.weight: copying a param with shape torch.Size([1600, 200]) from checkpoint, the shape in current model is torch.Size([15, 200]).
size mismatch for decoder.out.bias: copying a param with shape torch.Size([1600]) from checkpoint, the shape in current model is torch.Size([15]).
No model!
还有下面的报错
Traceback (most recent call last):
File "E:/hyx/seq2seq-master/seq2seq.py", line 436, in
seq.train()
File "E:/hyx/seq2seq-master/seq2seq.py", line 210, in train
loss, logits = self.step(inputs, targets, self.max_length)
File "E:/hyx/seq2seq-master/seq2seq.py", line 271, in step
return loss.data[0] / target_length, decoder_outputs
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
怎么调都不对,求指点~~
C:\ProgramData\Anaconda3\envs\torch\python.exe E:/hyx/seq2seq-master/seq2seq.py train C:\ProgramData\Anaconda3\envs\torch\lib\site-packages\torch\nn\modules\rnn.py:54: 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.05 and num_layers=1 "num_layers={}".format(dropout, num_layers)) Error(s) in loading state_dict for seq2seq: size mismatch for encoder.embedding.weight: copying a param with shape torch.Size([600, 100]) from checkpoint, the shape in current model is torch.Size([14, 100]). size mismatch for decoder.embedding.weight: copying a param with shape torch.Size([1600, 100]) from checkpoint, the shape in current model is torch.Size([15, 100]). size mismatch for decoder.out.weight: copying a param with shape torch.Size([1600, 200]) from checkpoint, the shape in current model is torch.Size([15, 200]). size mismatch for decoder.out.bias: copying a param with shape torch.Size([1600]) from checkpoint, the shape in current model is torch.Size([15]). No model! 还有下面的报错 Traceback (most recent call last): File "E:/hyx/seq2seq-master/seq2seq.py", line 436, in
seq.train()
File "E:/hyx/seq2seq-master/seq2seq.py", line 210, in train
loss, logits = self.step(inputs, targets, self.max_length)
File "E:/hyx/seq2seq-master/seq2seq.py", line 271, in step
return loss.data[0] / target_length, decoder_outputs
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
怎么调都不对,求指点~~