Open konimaki2022 opened 2 years ago
Hi, I am not able to reproduce the issue. Just to mention, nvidia-smi
shows VRAM in use even if no tensor/object is the memory as torch reserves the memory for faster access.
Hello! VRAM was always around 80% after finishing the first prompt, and when trying to launch the next one, I got a CUDA memory allocation error forcing me to restart gradio every time.
I solved it after putting that line in:
del samples_ddim
del x_sample
del x_samples_ddim
torch.cuda.empty_cache()
After that it allows me to run one prompt after another without having to restart it.
After finishing the execution of a prompt in gradio, the cache of the VRAM is not released, forcing in systems with low VRAM to restart the execution of the service and reload the model, previous to launch a new prompt.
This happened to me with a NVIDIA GTX 1660 6GB.
It can be solved with
torch.cuda.empty_cache()