File "/workspace/nlp-notebook/4-3.Transformer/model.py", line 256, in forward
enc_src = self.encoder(src, src_mask)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/nlp-notebook/4-3.Transformer/model.py", line 35, in forward
src = self.dropout((self.tok_embedding(src) * self.scale) + self.pos_embedding(pos))
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 156, in forward
return F.embedding(
File "/opt/conda/lib/python3.8/site-packages/torch/nn/functional.py", line 1916, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self
生成模型Transformer有以上错误,排除了软件包版本问题,S2S+attention也有bug,具体和之前一个issue一样,tuple和tensor的问题