Open ayushi-3536 opened 1 year 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
Hi Could you share a snippet of code to reproduce the error? Also, ideally, share the environment setup? Thanks.
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