Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running PESQ file #9

Open
ana-kuznetsova opened this issue Feb 24, 2021 · 2 comments
Open

Running PESQ file #9

ana-kuznetsova opened this issue Feb 24, 2021 · 2 comments

Comments

@ana-kuznetsova
Copy link

ana-kuznetsova commented Feb 24, 2021

Hi, Jason

I am trying to run MetricGAN.py But it fails while executing the read_pesq function.

def read_pesq(clean_root, enhanced_file, sr):
    f=enhanced_file.split('/')[-1]       
    wave_name=f.split('_')[-1].split('@')[0]
    clean_file=clean_root+'Train_'+wave_name+'.wav'
    
    cmd = PESQ_path+'/PESQ {} {} +{}'.format(clean_file, enhanced_file, sr)
    proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
    out = proc.communicate()
    pesq = float(out[0][-6:-1])
    return (pesq+0.5)/5.0

The particular error is (line 84):

    pesq = float(out[0][-6:-1])
ValueError: could not convert string to float:

I tried running it separately in bash in format

PESQ clean.wav enhanced.wav 16000

The error is PESQ: command not found

Could you, please, share more detail about how to use PESQ file?

Thank you very much!

@JasonSWFu
Copy link
Owner

Hi Ana,

The error "ValueError: could not convert string to float:" comes from pesq function doesn't run properly.

you can test it on your command line by typing (under the directory of the PESQ file): ./PESQ clean.wav enhanced.wav +16000

Sincerely,
Szu-Wei

@ImranKibria
Copy link

Hey Jason,

As you suggested, I tested PESQ on the command line.

For some sound files, everything works perfectly and I get an output like 'Prediction : PESQ_MOS = 1.391'.
image

But in other cases, I get 'Processing error!'.
image

Did you come across this problem? For reference, I am using the voicebank dataset. The testing file p232_001.wav works fine, but the testing file p232_002.wav did not. Thanks!

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

No branches or pull requests

3 participants