ParameterError: Audio Buffer Is Not Finite Everywhere
While using the following code on one of the sound files of Urban Sound Dataset, s, r = librosa.load(train_filename[7543]) tonnetz = librosa.feature.tonnetz(y = librosa.effects.har
Solution 1:
I recently encountered with this problem as well. The utils.py
in librosa package has validation functions like this:
Returns
-------
valid : bool
True if all tests pass
Raises
------
ParameterError
If `y` fails to meet the following criteria:
- `type(y)` is `np.ndarray`
- `y.dtype` is floating-point
- `mono == True` and `y.ndim` is not 1
- `mono == False` and `y.ndim` is not 1 or 2
- `np.isfinite(y).all()` is not True
and np.isfinite(y).all()
is one of the validations. So if the numpy array y
is not finite everywhere, which means y
has INF
, NaN
or something similar, python will raise the exception above. Just check the numpy variables you used above and modify their infinite parts.
I hope this will be helpful to you.
Post a Comment for "ParameterError: Audio Buffer Is Not Finite Everywhere"