fatchord / WaveRNN

WaveRNN Vocoder + TTS

Home Page:https://fatchord.github.io/model_outputs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tensor CPU issue

ayunus22198 opened this issue · comments

i am trying to run on gpu using google colab. I get this error: File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 492, in array
return self.numpy()
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

I had the same problem when running train_wavernn.py.
In my case it was solved by changing line 129 in voc_train_loop function to

if np.isnan(grad_norm.cpu()):
commented

You can also change self.numpy() to self.cpu().numpy() in tensor.py

You can also use if torch.isnan(grad_norm):