HPOBench icon indicating copy to clipboard operation
HPOBench copied to clipboard

Issue due to Numpy alias type deprecation

Open ayushi-3536 opened this issue 2 years ago • 3 comments

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

ayushi-3536 avatar Mar 14 '23 18:03 ayushi-3536

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

Husam94 avatar Oct 10 '23 15:10 Husam94

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

Neeratyoy avatar Oct 16 '23 23:10 Neeratyoy

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

benjamc avatar Apr 26 '24 11:04 benjamc