yongxuUSTC / sednn

deep learning based speech enhancement using keras or pytorch, make it easy to use
http://staff.ustc.edu.cn/~jundu/The%20team/yongxu/demo/SE_DNN_taslp.html
334 stars 124 forks source link

An error in function additive _mixing() #22

Closed panxin801 closed 5 years ago

panxin801 commented 5 years ago

/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py:2920: RuntimeWarning: Mean of empty slice. out=out, kwargs) /home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "prepare_data.py", line 477, in calculate_mixture_features(args) File "prepare_data.py", line 179, in calculate_mixture_features (mixed_audio, speech_audio, noise_audio, alpha) = additive_mixing(speech_audio, noise_audio) File "prepare_data.py", line 247, in additive_mixing alpha = 1. / np.max(np.abs(mixed_audio)) File "/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2334, in amax initial=initial) File "/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 83, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, passkwargs) ValueError: zero-size array to reduction operation maximum which has no identity

I think this error happened because of the return value of np.max(np.abs(mixed_audio)) is too small, then computers ignore it as a zero(0), so the error occurs, so does my thought is right? I am looking forword to your receive. Thanks a lot

qiuqiangkong commented 5 years ago

Hi,

When we use the TIMIT and the noise database mentioned in the code, we did not came across this problem. The mixed_audio should not be 0 if the data is loaded correctly. Maybe check if your mixed_audio is 0?

Best wishes,

Qiuqiang


From: Xin Xin notifications@github.com Sent: 26 December 2018 03:46:59 To: yongxuUSTC/sednn Cc: Subscribed Subject: [yongxuUSTC/sednn] An error in function additive _mixing() (#22)

/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py:2920: RuntimeWarning: Mean of empty slice. out=out, kwargs) /home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount) Traceback (most recent call last): File "prepare_data.py", line 477, in calculate_mixture_features(args) File "prepare_data.py", line 179, in calculate_mixture_features (mixed_audio, speech_audio, noise_audio, alpha) = additive_mixing(speech_audio, noise_audio) File "prepare_data.py", line 247, in additive_mixing alpha = 1. / np.max(np.abs(mixed_audio)) File "/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2334, in amax initial=initial) File "/home/panxin/anaconda2/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 83, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, passkwargs) ValueError: zero-size array to reduction operation maximum which has no identity

I think this error happened because of the return value of np.max(np.abs(mixed_audio)) is too small, then computers ignore it as a zero(0), so the error occurs, so does my thought is right? I am looking forword to your receive. Thanks a lot

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/yongxuUSTC/sednn/issues/22, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMt5ybeq0ExR264mhTexpYsAjTKKAhJ7ks5u8vEzgaJpZM4ZhVfg.

panxin801 commented 5 years ago

Hi , yesterday, I found that mixed_audio is 0, however noise_speech is 0 and clean_speech is not 0. When they created the mixed_audio, it is 0 then. But in the prepare_data.py mixed_audio = s+ n , that made me wonder why mixed_audio = s+ n not s*n

yongxuUSTC commented 5 years ago

Hi,

This is a basic question. For additive noise, y=s + n For convolutive noise, like the room impulse response. y = sn where "" stands for convolutive operation.

Best regards, yong

On Wed, 26 Dec 2018 at 18:02, Xin Xin notifications@github.com wrote:

Hi , yesterday, I found that mixed_audio is 0, however noise_speech is 0 and clean_speech is not 0. When they created the mixed_audio, it is 0 then. But in the prepare_data.py mixed_audio = s+ n , that made me wonder why mixed_audio = s+ n not s*n

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yongxuUSTC/sednn/issues/22#issuecomment-450055111, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJj0jthQuR2GzNgDPqUKdFSyxbDRGaiks5u9Co4gaJpZM4ZhVfg .

panxin801 commented 5 years ago

Hi, This is a basic question. For additive noise, y=s + n For convolutive noise, like the room impulse response. y = sn where "" stands for convolutive operation. Best regards, yong On Wed, 26 Dec 2018 at 18:02, Xin Xin @.**> wrote: Hi , yesterday, I found that mixed_audio is 0, however noise_speech is 0 and clean_speech is not 0. When they created the mixed_audio, it is 0 then. But in the prepare_data.py mixed_audio = s+ n , that made me wonder why mixed_audio = s+ n not sn — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#22 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFJj0jthQuR2GzNgDPqUKdFSyxbDRGaiks5u9Co4gaJpZM4ZhVfg .

ok I get it ,thanks doc yongxu.