Skip to content

the beat tracking rely on numpy=<1.19 #527

@nicolaus625

Description

@nicolaus625
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions