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

the beat tracking rely on numpy=<1.19 #527

Open
nicolaus625 opened this issue Aug 24, 2023 · 5 comments
Open

the beat tracking rely on numpy=<1.19 #527

nicolaus625 opened this issue Aug 24, 2023 · 5 comments

Comments

@nicolaus625
Copy link

from madmom.features.beats import DBNBeatTrackingProcessor

File "/.conda/envs/muvi/lib/python3.9/site-packages/madmom/init.py", line 24, in
from . import audio, evaluation, features, io, ml, models, processors, utils
File "/.conda/envs/muvi/lib/python3.9/site-packages/madmom/evaluation/init.py", line 874, in
from . import chords, beats, notes, onsets, tempo
File "/.conda/envs/muvi/lib/python3.9/site-packages/madmom/evaluation/chords.py", line 35, in
from ..io import load_chords
File "/.conda/envs/muvi/lib/python3.9/site-packages/madmom/io/init.py", line 22, in
SEGMENT_DTYPE = [('start', np.float), ('end', np.float), ('label', object)]
File "/.conda/envs/muvi/lib/python3.9/site-packages/numpy/init.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

The error message you're encountering indicates that there's a deprecated usage of np.float in the Madmom library's io module. The message suggests that np.float is no longer a valid attribute in recent versions of NumPy (starting from version 1.20), and you should use either the built-in float type or np.float64 if you specifically need a NumPy scalar type.

To resolve this issue, you need to update the affected code in the Madmom library. Specifically, you should replace instances of np.float with either float or np.float64, depending on the context.

For example, if the problematic line of code is:

SEGMENT_DTYPE = [('start', np.float), ('end', np.float), ('label', object)]
You can modify it to use float:

SEGMENT_DTYPE = [('start', float), ('end', float), ('label', object)]
Or, if you want to use the NumPy scalar type:

SEGMENT_DTYPE = [('start', np.float64), ('end', np.float64), ('label', object)]
Make sure to make these changes in the Madmom library's source code where the error is originating from. After making the necessary changes, the error should be resolved, and the code should work without issues.

@superbock
Copy link
Collaborator

Yes, there are many of these problems in there. Unfortunately I have not found time to fix the CI pipeline. Once this is fixed, it is easy to update these kind of issues. Nonetheless, please feel free to create a PR.

@tobq
Copy link

tobq commented Sep 1, 2023

same issue

@relascope
Copy link

[temp solution]

Had the same problem, already thinking about porting it to the new version (didn't: lack of time)

pip3 install "numpy<1.19" scipy cython mido pytest pyaudio pyfftw  

If you tell the specific mumpy version, the other packages won't use the newest version and - if installed together with scipy - won't replace the desired working numpy version.

Things like this should be integrated somewhere in the docs.

Finally, time to dig into madmom, maybe I can use it for chordola.

@niliha
Copy link

niliha commented Jan 17, 2024

Seems like the last pypy release is heavily outdated (Nov 14, 2018) and the issue is not present on the main branch.

Therefore the easiest way is to just install the most recent version from source, i.e.

pip install git+https://github.com/CPJKU/madmom.git

@GrillingUXO
Copy link

I created a pull request, hope It works!
#542

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

6 participants