-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of Memory on Synthesis #37
Comments
@dyelax : are you getting OOM from NVIDIA Cuda or are you running out of main RAM? I can't see anything in r9y9's code where it would run OOM on GPU, but rather a place where it could run out of memory on main RAM if the audio to be generated is too long. I have just generated an audio of 240,000 frames (yours is 195,328) and I had no problems with GTX 1080 Ti (11GB). BUT: I have 128GB of RAM... Also: what sample-rate are you using? You should not go beyond 22-24KHz |
It's definitely a CUDA memory issue. Here's the error I'm getting:
I have 16GB RAM, but again, this definitely seems like a GPU memory problem. Especially sice I can see the GPU memory climbing and hitting max in I'm running inside of a docker container (built off the pytorch docker) if that could be a potential issue. |
Hmm, we are using Python 3.5 and no Docker-images. The problem is that Sorry that I can't help more... |
@dyelax What about synthesizing on cpu? I think it may run faster. |
I got this problem in a few days ago, i will sent pr later, i fixed it. |
I'm not sure if I can write pytorch code that triggers OOM, without accessing low-level APIs of CUDA. Isn't it a GPU driver bug or pytorch bug? |
I'm curious to see a fix by @neverjoe. |
@dyelax Also try to restart server/computer and execute same command again and see if problem persists. Sometimes I run into similar problems after killing training process which seams to later cause memory allocation issues. |
I have checked the synthesis process, in the wavenet_vocoder/wavenet_vocoder/wavenet.py Line 355 in 4d5f68c
the x is the type of Variable when we save it in the list, this will case the memory increase in the sample process.so we should change this to outputs += [x.cpu().data.numpy()] and change wavenet_vocoder/wavenet_vocoder/wavenet.py Line 325 in 4d5f68c
to current_input=Variable(torch.from_numpy(current_input)) if next(self.parameters()).is_cuda: current_input=current_input.cuda()
|
@azraelkuan do you meet error when changed to
|
@butterl i guess that you forget to change the tensor to numpy https://github.com/azraelkuan/wavenet_vocoder/blob/828da55c4e5dd29f05413b4ec7b9afa04bfe39a3/wavenet_vocoder/wavenet.py#L359 |
@azraelkuan Thanks Kuan , checked your repo, after merged all the related code it's OK now 😄 but from my server, the evalution(50+it/s) is much faster than the one before patch(10-13 it/s) , any instruction on the speed up modification ? |
Sorry for chiming in late. I understand the memory usage increases in the sampling process but I don't think it triggers OOM unless you are trying to synthesis too long audio. I'm wondering CPU<->GPU data transform per-sample is inefficient, though I don't care the speed so much since it's already super slow. |
This should be fixed by #55. Feel free to reopen if the issue persists. |
When running
python synthesis.py <model_checkpoint_path> <output_dir> --conditional <mel_path>
, I consistently run out of GPU memory about 4 minutes into synthesis. I have a GTX 1080Ti (11GB memory), and when I watchnvidia-smi
while synthesis is running, the memory usage continually increases until it runs out. How much GPU memory is generally required to synthesize a clip?For reference, here is the progress on
ljspeech-mel-00001.npy
before it failed most recently:33249/195328 [03:57<19:18, 139.90it/s]
The text was updated successfully, but these errors were encountered: