HoneyTian commited on
Commit
5fdce47
·
1 Parent(s): a3e0429
examples/spectrum_unet_irm_aishell/step_2_train_model.py CHANGED
@@ -138,6 +138,10 @@ class CollateFunction(object):
138
 
139
  # noise_spec, speech_spec, mix_spec, speech_irm
140
  # shape: [freq_dim, time_steps]
 
 
 
 
141
 
142
  snr_db: torch.Tensor = 10 * torch.log10(
143
  speech_spec / (noise_spec + self.epsilon)
 
138
 
139
  # noise_spec, speech_spec, mix_spec, speech_irm
140
  # shape: [freq_dim, time_steps]
141
+ if torch.any(torch.isnan(speech_spec)) or torch.any(torch.isinf(speech_spec)):
142
+ raise AssertionError("nan or inf in speech_spec")
143
+ if torch.any(torch.isnan(noise_spec)) or torch.any(torch.isinf(noise_spec)):
144
+ raise AssertionError("nan or inf in noise_spec")
145
 
146
  snr_db: torch.Tensor = 10 * torch.log10(
147
  speech_spec / (noise_spec + self.epsilon)