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

Issue due to Numpy alias type deprecation #172

Open
ayushi-3536 opened this issue Mar 14, 2023 · 3 comments · May be fixed by #186
Open

Issue due to Numpy alias type deprecation #172

ayushi-3536 opened this issue Mar 14, 2023 · 3 comments · May be fixed by #186

Comments

@ayushi-3536
Copy link

Hi, the current requirement for numpy is set to version >=1.18.1. However the latest version installment(v1.24.0) throws module ‘numpy’ has no attribute ‘float’. This is caused by the removal of numpy’s aliases for float, int and similar dtypes in latest version. This can be either fixed by setting the max_version limit on this dependency or by modifying the source code(utils/container_util.py) to use equivalent built-in types

@Husam94
Copy link

Husam94 commented Oct 10, 2023

Hi, I have a similar problem when trying to use the surrogate benchmarks (specifically the SurrogatesSVMBenchmark):

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

@Neeratyoy
Copy link
Collaborator

Hi
Could you share a snippet of code to reproduce the error?
Also, ideally, share the environment setup?
Thanks.

@benjamc
Copy link

benjamc commented Apr 26, 2024

Same issue here. Replacing np.float by float in this line fixes the error. See this PR #186.

@benjamc benjamc linked a pull request Apr 26, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants