Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

During eval: ValueError: fs (sampling frequency) should be either 8000 or 16000 #38

Closed
youssefavx opened this issue Jan 10, 2021 · 4 comments

Comments

@youssefavx
Copy link

Hey guys, while training on Colab with a sample rate of 32kHz, the training was going fine up until it started the evaluation process.

I first got this warning multiple times:

 Run model on reference ref and degraded deg
       Sample rate (fs) - No default. Must select either 8000 or 16000.
       Note there is narrow band (nb) mode only when sampling rate is 8000Hz.

[2021-01-10 11:40:29,138][denoiser.evaluate][INFO] - Eval estimates | 116/148 | 12.1 it/sec

 Run model on reference ref and degraded deg
       Sample rate (fs) - No default. Must select either 8000 or 16000.
       Note there is narrow band (nb) mode only when sampling rate is 8000Hz.

 Run model on reference ref and degraded deg
       Sample rate (fs) - No default. Must select either 8000 or 16000.
       Note there is narrow band (nb) mode only when sampling rate is 8000Hz.

And so on...

And then I got this error:

[2021-01-10 11:40:31,883][__main__][ERROR] - Some error happened
concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/content/denoiser/denoiser/evaluate.py", line 91, in _run_metrics
    pesq_i = get_pesq(clean, estimate, sr=args.sample_rate)
  File "/content/denoiser/denoiser/evaluate.py", line 108, in get_pesq
    pesq_val += pesq(sr, ref_sig[i], out_sig[i], 'wb')
  File "/usr/local/lib/python3.6/dist-packages/pesq/__init__.py", line 28, in pesq
    raise ValueError("fs (sampling frequency) should be either 8000 or 16000")
ValueError: fs (sampling frequency) should be either 8000 or 16000
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "train.py", line 104, in main
    _main(args)
  File "train.py", line 98, in _main
    run(args)
  File "train.py", line 79, in run
    solver.train()
  File "/content/denoiser/denoiser/solver.py", line 170, in train
    pesq, stoi = evaluate(self.args, self.model, self.tt_loader)
  File "/content/denoiser/denoiser/evaluate.py", line 72, in evaluate
    pesq_i, stoi_i = pending.result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
ValueError: fs (sampling frequency) should be either 8000 or 16000

For the test set, should I convert the files to 16kHz? Wouldnt make much sense since I'm training on 32kHz.

@adiyoss
Copy link
Contributor

adiyoss commented Jan 10, 2021

Hi @youssefavx,
Yes this is expected since the PESQ metric is defined only for sampling rate of 8K and 16K.
You can either downsample before computing PESQ or just comment this evaluation function and just consider STOI or the L1 loss.

@youssefavx
Copy link
Author

Ah! makes sense, I'll try both! Thank you!

@008karan
Copy link

008karan commented Jun 9, 2021

@youssefavx I am also training on valentini data for 8khz. What are you using for validation as there is only train and test audios are present in valentini corpus.

@alifim
Copy link

alifim commented May 24, 2023

@008karan I manually split the train into train and validation dataset

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants