vincentherrmann / pytorch-wavenet

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

generate function falls at last hurdle #36

Open markhanslip opened 4 years ago

markhanslip commented 4 years ago

firstly thanks so much for the implementation :) all runs fine until end of generate function, when this happens:

RuntimeError Traceback (most recent call last)

in 9 first_samples=start_data, 10 #progress_callback=prog_callback, - need to add this to wavenet_model.py ---> 11 temperature=1.) ~/WaveNet/wavenet_model.py in generate(self, num_samples, first_samples, temperature) 230 231 generated = (generated / self.classes) * 2. - 1 --> 232 mu_gen = mu_law_expansion(generated, self.classes) 233 234 self.train() ~/WaveNet/audio_data.py in mu_law_expansion(data, mu) 155 156 def mu_law_expansion(data, mu): --> 157 s = np.sign(data) * (np.exp(np.abs(data) * np.log(mu + 1)) - 1) / mu 158 return s RuntimeError: Expected object of type torch.LongTensor but found type torch.DoubleTensor for argument #2 'other'