can't save the audio

#1
by hellos - opened

Save the audio to disk in a file called speech.wav

sf.write("speech.wav", audio.to('cpu').numpy(), 22050)

this gives a error:

Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

To solve this replace the code:

sf.write("speech.wav", audio.to('cpu').detach().numpy()[0], 22050)

hellos changed discussion status to closed

Sign up or log in to comment