DeepComplexCRN icon indicating copy to clipboard operation
DeepComplexCRN copied to clipboard

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

Open RuqiaoLiu opened this issue 3 years ago • 5 comments

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

RuqiaoLiu avatar Dec 10 '21 12:12 RuqiaoLiu

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

changingBin avatar Jan 16 '22 07:01 changingBin

嗯,建议使用speechBrain里写的复BN。

--------------原始邮件-------------- 发件人:"changingBin @.>; 发送时间:2022年1月16日(星期天) 下午3:05 收件人:"huyanxin/DeepComplexCRN" @.>; 抄送:"刘汝桥 @.>;"Author @.>; 主题:Re: [huyanxin/DeepComplexCRN] ComplexBatchNorm在训练过程中内存占用不断升高 (Issue #20)

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

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

RuqiaoLiu avatar Jan 16 '22 12:01 RuqiaoLiu

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

victorVoice avatar Aug 16 '22 07:08 victorVoice

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

FragrantRookie avatar Sep 17 '22 07:09 FragrantRookie

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就可以

victorVoice avatar Sep 19 '22 06:09 victorVoice