mailong25 / self-supervised-speech-recognition

speech to text with self-supervised learning based on wav2vec 2.0 framework
379 stars 114 forks source link

memory leak with stt.py #58

Open tensorfoo opened 2 years ago

tensorfoo commented 2 years ago

Hi, If you do an inference with a Transcriber object t.transcribe(..), after returning the result, it should release any resources related to that inference. But it stays on VRAM and after a few calls to t.transcribe(), I get CUDA related out of memory errors. Looking at nvidia-smi it shows the memory is still occupied even after the transcript has been returned.

It would be nice to have a long lived Transcriber object which can be reused avoiding the lengthy creation time. If you're busy please give me a hint on how it may be done so I can give it a shot and submit a PR. Thanks for your project.

EdenJin20171503024 commented 2 years ago

hi, I have the same problem, have you slove it?

Hi, If you do an inference with a Transcriber object t.transcribe(..), after returning the result, it should release any resources related to that inference. But it stays on VRAM and after a few calls to t.transcribe(), I get CUDA related out of memory errors. Looking at nvidia-smi it shows the memory is still occupied even after the transcript has been returned.

It would be nice to have a long lived Transcriber object which can be reused avoiding the lengthy creation time. If you're busy please give me a hint on how it may be done so I can give it a shot and submit a PR. Thanks for your project.

HI I have the same problem, have you slove it?