You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "train.py", line 208, in
main(opt)
File "train.py", line 72, in main
train_loss, train_sents = train(model, criterion, optimizer, train_iter, model_state)
File "train.py", line 113, in train
dec_inputs, dec_inputs_len)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer\models.py", line 152, in forward
enc_outputs, enc_self_attns = self.encoder(enc_inputs, enc_inputs_len, return_attn)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer\models.py", line 59, in forward
enc_outputs = self.src_emb(enc_inputs)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\sparse.py", line 110, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1110, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'
The text was updated successfully, but these errors were encountered:
This error occurs when I run train.py
Traceback (most recent call last):
File "train.py", line 208, in
main(opt)
File "train.py", line 72, in main
train_loss, train_sents = train(model, criterion, optimizer, train_iter, model_state)
File "train.py", line 113, in train
dec_inputs, dec_inputs_len)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer\models.py", line 152, in forward
enc_outputs, enc_self_attns = self.encoder(enc_inputs, enc_inputs_len, return_attn)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\transformer-master\transformer\models.py", line 59, in forward
enc_outputs = self.src_emb(enc_inputs)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Anaconda3\lib\site-packages\torch\nn\modules\sparse.py", line 110, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "C:\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1110, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected object of type torch.cuda.LongTensor but found type torch.LongTensor for argument #3 'index'
The text was updated successfully, but these errors were encountered: