Please tell me how to fix it. @MisterSchmitz
RuntimeError Traceback (most recent call last)
in
4 # Training
5 for i, song_idx in enumerate(train_idxs):
----> 6 this_loss = some_pass(*song_to_seq_target(data[song_idx]))
7 loss += this_loss
8
in some_pass(seq, target, fit)
5
6 for i, c in enumerate(seq):
----> 7 output = model(c)
8 some_loss += loss_function(output, target[i])
9
F:\Ana\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
--> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)
in forward(self, seq)
26
27 def forward(self, seq):
---> 28 embeds = self.embeddings(seq.view(1, -1))
29 rnn_out, self.hidden = self.rnn(embeds.view(1,1,-1), self.hidden)
30 rnn_out = self.drop(rnn_out)
F:\Ana\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
--> 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)
F:\Ana\lib\site-packages\torch\nn\modules\sparse.py in forward(self, input)
112 return F.embedding(
113 input, self.weight, self.padding_idx, self.max_norm,
--> 114 self.norm_type, self.scale_grad_by_freq, self.sparse)
115
116 def extra_repr(self):
F:\Ana\lib\site-packages\torch\nn\functional.py in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)
1482 # remove once script supports set_grad_enabled
1483 no_grad_embedding_renorm(weight, input, max_norm, norm_type)
-> 1484 return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
1485
1486
RuntimeError: Expected object of device type cuda but got device type cpu for argument #3 'index' in call to _th_index_select