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

ComplexBatchNorm在训练过程中内存占用不断升高 #20

Open
RuqiaoLiu opened this issue Dec 10, 2021 · 5 comments
Open

ComplexBatchNorm在训练过程中内存占用不断升高 #20

RuqiaoLiu opened this issue Dec 10, 2021 · 5 comments

Comments

@RuqiaoLiu
Copy link

RuqiaoLiu commented Dec 10, 2021

您好:
我发现把ComplexBatchNorm中的track_running_stats设置为True,在训练过程中的内存占用会不断上升,最终导致内存爆炸。请问您在训练DCCRN时没有出现该问题吗?
谢谢;
祝好!

@RuqiaoLiu RuqiaoLiu changed the title ComplexBatchNorm再训练过程中内存占用不断升高 ComplexBatchNorm在训练过程中内存占用不断升高 Dec 10, 2021
@changingBin
Copy link

我也遇到这个问题了 排查了好久才发现的

@RuqiaoLiu
Copy link
Author

RuqiaoLiu commented Jan 16, 2022 via email

@victorVoice
Copy link

https://discuss.pytorch.org/t/how-does-batchnorm-keeps-track-of-running-mean/40084/15 可以参考这个来做修改,应该也是再计算running_mean, runing_var的时候lerp把mean,var也加入计算图里面了

@FragrantRookie
Copy link

我也遇到了这个问题,请问你解决了吗?

@victorVoice
Copy link

complexnn 文件里
if self.training and self.track_running_stats:
self.num_batches_tracked += 1
if self.momentum is None: # use cumulative moving average
exponential_average_factor = 1.0 / self.num_batches_tracked.item()
else: # use exponential moving average
exponential_average_factor = self.momentum
.item() 加一个detach就可以

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

4 participants