syang1993 / FFTNet

A PyTorch implementation of the FFTNet: a Real-Time Speaker-Dependent Neural Vocoder
92 stars 19 forks source link

ask for help #6

Open li-xx-5 opened 5 years ago

li-xx-5 commented 5 years ago

hi,i met the erro,when i ran train.py,how can i solve the problem?thank you

Traceback (most recent call last): File "train.py", line 180, in train_fn(args) File "train.py", line 157, in train_fn waveform = mu_law_decode(np.asarray(samples[model.module.receptive_field:]),hparams.quantization_channels) File "/usr/local/lib/python3.6/dist-packages/numpy/core/numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 450, in array return self.numpy() TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

szokejokepu commented 5 years ago

You have to change it to samples[model.module.receptive_field:].cpu().numpy()