Skip to content
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

Long duration causing memory leaks #356

Closed
eypklyc opened this issue Jul 23, 2023 · 2 comments
Closed

Long duration causing memory leaks #356

eypklyc opened this issue Jul 23, 2023 · 2 comments

Comments

@eypklyc
Copy link

eypklyc commented Jul 23, 2023

Hi,

I'm using Silero VAD to catch speeches in a long audio records. When using get_speech_timestamps function it's causing memory leak. Eventually the process consuming all memory and starting to write swap. Any advice to prevent this apart from cutting the samples multiple pieces?

speech_prob = model(chunk, sampling_rate).item()

Just for information using reset states solving the problem but making predictions less accurate...

@snakers4
Copy link
Owner

Does this help?
#2 (comment)

long audio record

How long? How much memory is used for audios of which size?
You can consider trying the streaming interface if your audio is very long or "eternal".

Any advice to prevent this apart from cutting the samples multiple pieces?
Just for information using reset states solving the problem but making predictions less accurate ...

Cutting audio into 5-15m long segments should not harm the overall quality very much.
Resetting states forgets some context, but it should be negligible compared to the overall length of audio.

@snakers4 snakers4 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
@eypklyc
Copy link
Author

eypklyc commented Sep 22, 2023

Sorry for the late reply. Yes that helped very well, disabling the gradients solved the leakage

torch.set_grad_enabled(False)

Thank you for the support..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants