I'm very newbie on pytorch and deep learning, and I got some error while running a sample code from deep learning class.
When I run the code I attached below, There comes an errors like,
text = torch.from_numpy(data['text']).long().cuda(0)
# feature extraction
mel_gt = get_mel(audio)
# shift mel spectrogram -> the input of the network
mel_shift = torch.cat((torch.zeros_like(mel_gt)[:,:,:1], mel_gt[:,:,:-1]) ,axis=-1)
# inference
mel_est, attention = model(mel_shift, text)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
I can hardly understand because I also check whether the tensors are on cuba with these code, they all return true..
print(mel_shift.is_cuda)
print(mel_gt.is_cuda)
print(text.is_cuda)
Can you guys figure out what's the problem?? I need big big help,,