Spaces:
Running
Running
update
Browse files
examples/conv_tasnet/run.sh
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
: <<'END'
|
4 |
|
5 |
|
6 |
-
sh run.sh --stage
|
7 |
--noise_dir "/data/tianxing/HuggingDatasets/nx_noise/data/noise/dns3-noise" \
|
8 |
--speech_dir "/data/tianxing/HuggingDatasets/nx_noise/data/speech/dns3-speech" \
|
9 |
--max_epochs 400
|
|
|
3 |
: <<'END'
|
4 |
|
5 |
|
6 |
+
sh run.sh --stage 2 --stop_stage 2 --system_version centos --file_folder_name file_dir --final_model_name conv-tasnet-dns3-20250319 \
|
7 |
--noise_dir "/data/tianxing/HuggingDatasets/nx_noise/data/noise/dns3-noise" \
|
8 |
--speech_dir "/data/tianxing/HuggingDatasets/nx_noise/data/speech/dns3-speech" \
|
9 |
--max_epochs 400
|
toolbox/torchaudio/losses/perceptual.py
CHANGED
@@ -88,6 +88,11 @@ class PesqLoss(nn.Module):
|
|
88 |
|
89 |
batch_loss = self.loss_fn.forward(clean, denoise)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
91 |
if self.reduction == "mean":
|
92 |
loss = torch.mean(batch_loss)
|
93 |
elif self.reduction == "sum":
|
|
|
88 |
|
89 |
batch_loss = self.loss_fn.forward(clean, denoise)
|
90 |
|
91 |
+
mask = ~(torch.isnan(batch_loss) | torch.isinf(batch_loss))
|
92 |
+
batch_loss = batch_loss[mask]
|
93 |
+
if len(batch_loss) == 0:
|
94 |
+
raise AssertionError
|
95 |
+
|
96 |
if self.reduction == "mean":
|
97 |
loss = torch.mean(batch_loss)
|
98 |
elif self.reduction == "sum":
|