gabrielmittag / NISQA

NISQA - Non-Intrusive Speech Quality and TTS Naturalness Assessment
MIT License
663 stars 117 forks source link

ValueError: n_wins 2072 > max_length 1300 #11

Closed LXP-Never closed 3 years ago

LXP-Never commented 3 years ago

Do I need to retrain the model with a larger max_length?

gabrielmittag commented 3 years ago

Hi,

No, you could just overwrite the maximum length in the config file. That being said, the model is not really made to estimate such long speech samples.

You can overwrite the config of the checkpoint and write a new checkpoint file with the model weights as follows:

import torch
checkpoint = torch.load('weights/nisqa.tar')
checkpoint['args']['ms_max_segments'] = 3000
torch.save(checkpoint, 'weights/nisqa_2.tar')

Then you can run the model with the new checkpoint:

python run_predict.py --mode predict_file --pretrained_model weights/nisqa_2.tar --deg /path/to/wav/file.wav 

Let me know if it works!

LXP-Never commented 3 years ago

it works! Thank you

gabrielmittag commented 3 years ago

Great!