ixobert / birds-generation

11 stars 1 forks source link

Librosa TypeError: resample() takes 1 positional argument but 3 were given #9

Closed sammlapp closed 5 months ago

sammlapp commented 5 months ago

Maybe I have a different version of librosa than expected by the package, mine is librosa 0.10.1. It might be a good idea to use positional arguments in all calls to librosa.resample:

https://github.com/ixobert/birds-generation/blob/cd55a99e00c291fcbcb77cbbd0621b93afe9ce03/src/interactive_app.py#L117

https://github.com/ixobert/birds-generation/blob/cd55a99e00c291fcbcb77cbbd0621b93afe9ce03/src/generate_samples.py#L55

https://github.com/ixobert/birds-generation/blob/cd55a99e00c291fcbcb77cbbd0621b93afe9ce03/src/dataloaders/audiodataset.py#L185

https://github.com/ixobert/birds-generation/blob/cd55a99e00c291fcbcb77cbbd0621b93afe9ce03/src/train_classifier.py#L66

(would become audio = librosa.resample(y=audio, orig_sr=_sr, target_sr=sr)

sammlapp commented 5 months ago

the same applies to librosa.util.fix_length, which becomes fix_length(data=audio, size=window_length) or fix_length(data=audio, size=sr*seconds)

ixobert commented 5 months ago

Thanks @sammlapp, I have updated the code accordingly.