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

effects.pitch_shift example throws an error #1681

Closed
ArztKlein opened this issue Mar 11, 2023 · 6 comments · Fixed by #1684
Closed

effects.pitch_shift example throws an error #1681

ArztKlein opened this issue Mar 11, 2023 · 6 comments · Fixed by #1684
Labels
management Project governance, packaging, distribution, etc Upstream/dependency bug Another package is causing us trouble!

Comments

@ArztKlein
Copy link

Describe the bug
A clear and concise description of what the bug is.
numpy.core._exceptions._UFuncNoLoopError: ufunc '_phasor_angles' did not contain a loop with signature matching types <class 'numpy.dtype[float32]'> -> None

To Reproduce
Run the example from https://librosa.org/doc/main/generated/librosa.effects.pitch_shift.html
Example:

import librosa

y, sr = librosa.load(librosa.ex('choice'))
y_third = librosa.effects.pitch_shift(y, sr=sr, n_steps=4)

Using local files doesn't work either.

Expected behavior
What should happen is that the example should work.

Software versions*

Windows-10-10.0.19044-SP0
Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
NumPy 1.22.2
SciPy 1.10.1
librosa 0.10.0
INSTALLED VERSIONS
------------------
python: 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]

librosa: 0.10.0

audioread: 3.0.0
numpy: 1.22.2
scipy: 1.10.1
sklearn: 1.2.2
joblib: 1.2.0
decorator: 4.4.2
numba: 0.56.4
soundfile: 0.12.1
pooch: v1.7.0
soxr: 0.3.4
typing_extensions: installed, no version number available
lazy_loader: installed, no version number available
msgpack: 1.0.5

numpydoc: None
sphinx: None
sphinx_rtd_theme: None
matplotlib: 3.5.1
sphinx_multiversion: None
sphinx_gallery: None
mir_eval: None
ipython: None
sphinxcontrib.rsvgconverter: None
pytest: 7.1.2
pytest_mpl: None
pytest_cov: 3.0.0
samplerate: None
resampy: None
presets: None
packaging: 21.3
@ArztKlein
Copy link
Author

The examples on the other effects throw errors also.

@bmcfee
Copy link
Member

bmcfee commented Mar 11, 2023

This looks like a duplicate of #1675 to me. We didn't quite get to the bottom of the issue there, but i believe the original poster did resolve it by reinstalling numba.

I still think this an upstream issue for us, but it might be helpful if you could take a look through the discussion on #1675 to see if anything there is helpful in getting a more specific diagnosis.

@ArztKlein
Copy link
Author

Yes that worked thank you!

Numpy was the problem for me. After reinstalling it, the numpy version became 1.23.5.
Not sure if that helps with the issue.

I'll leave the issue open unless you want to close it.

@bmcfee
Copy link
Member

bmcfee commented Mar 12, 2023

Cool, thanks for confirming!

Let's leave this open for now, though i expect there's nothing to be done from our side. I think there must be a strange interaction happening in our dependencies that is somehow not being detected by our (minimum version pin) test suite.

@bmcfee
Copy link
Member

bmcfee commented Mar 14, 2023

Ok, I did a bit more digging, and i think it might actually be down to a couple of issues specific to numpy 1.22(.2). The following are listed in the 1.22.3 release notes, and might be to blame:

As far as I can tell, these PRs fix some regressions introduced somewhere between 1.20.3 (our minimum required / tested) and 1.22.2, and both are related to ufunc behavior.

@bmcfee bmcfee added management Project governance, packaging, distribution, etc Upstream/dependency bug Another package is causing us trouble! labels Mar 16, 2023
@bmcfee
Copy link
Member

bmcfee commented Mar 16, 2023

Did a bit of digging today, and was able to reproduce the failure with numpy. Here's a summary of how it fares on different numpies (all other dependencies fixed: numba 0.55.2, llvmlite 0.38.1).

  • 1.22.3: works
  • 1.22.2: fails
  • 1.22.1: fails
  • 1.22.0: fails
  • 1.21.6: works

I think this confirms the above diagnosis. Probably the thing to do is update the package recipe to avoid 1.22.[012]. This is doable on conda-forge with a build bump. Pypi will need a 0.10.0.post0 package or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
management Project governance, packaging, distribution, etc Upstream/dependency bug Another package is causing us trouble!
Development

Successfully merging a pull request may close this issue.

2 participants