-
Notifications
You must be signed in to change notification settings - Fork 709
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
[Task]: EfficientAD OutOfMemory exception (fix included) #1301
Comments
Thanks for the fixing idea. It works, you still have to store the values before processing them. The best would probabaly be an "online" mean and variance calculation. The mean is trivial and standard deviation is calculated as follows https://math.stackexchange.com/questions/198336/how-to-calculate-standard-deviation-with-streaming-inputs |
I agree with @alexriedel1, it would be worth exploring the idea of using such statistical algorithms. I'm not that familiar with the topic, but I see that there can be some problems with precision and stability, so it'd be worth to explore this, and maybe offer this as a config option if it turns out to be unstable in some cases (tho I'm not sure how to verify). |
thanks ,it works, but will this affect training accuracy? |
What is the motivation for this task?
I ran into an OutOfMemory exception when calculating the teacher channel mean and standard deviation while training the EfficientAD model.
Describe the solution you'd like
I fixed this by not saving the teacher outputs to a list but instead iterating the dataloader twice.
This increases the runtime of the teacher_channel_mean_std() function, but only if the teacher outputs don't fit into memory.
I could create a pull request from my branch, but I didn't manage to get the pre-commit hooks running.
Additional context
No response
The text was updated successfully, but these errors were encountered: