vincentherrmann / pytorch-wavenet

An implementation of WaveNet with fast generation
MIT License
968 stars 225 forks source link

RuntimeError: Input type (CUDAFloatTensor) and weight type (CPUFloatTensor) should be the same #9

Closed problemsniper closed 6 years ago

problemsniper commented 6 years ago

I am getting this error on runtime. Does any one know what the problem might be?

vincentherrmann commented 6 years ago

Hi! Looks like the model is on the GPU, but the data is on the CPU. The WaveNetTrainer class has the attribute dtype which should be torch.cuda.FloatTensor if you're using a GPU. Are you running the train_script.py or the Jupyter notebook?

problemsniper commented 6 years ago

JUPYTER notebook which is deployed on the GPU AWS instance and accessing it from my Mac

pranavdheram commented 6 years ago

Hello, how did you fix this error?

sylvchev commented 5 years ago

Adding a model.cuda() before training solve the issue.