automl / HPOBench

Collection of hyperparameter optimization benchmark problems
Apache License 2.0
133 stars 35 forks source link

Issue due to Numpy alias type deprecation #172

Open ayushi-3536 opened 1 year ago

ayushi-3536 commented 1 year ago

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 commented 11 months ago

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 commented 11 months ago

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

benjamc commented 4 months ago

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