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

[🐛BUG] np.float not supported in numpy >= 1.20. #1714

Closed
ElkanaBaris opened this issue Mar 26, 2023 · 6 comments
Closed

[🐛BUG] np.float not supported in numpy >= 1.20. #1714

ElkanaBaris opened this issue Mar 26, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ElkanaBaris
Copy link
Contributor

Describe the bug
using dtype=np.float is not supported in numpy anymore

To Reproduce
pip install requirements.txt
Just run you evaluator/metrics.py for example:

File "/opt/anaconda3/envs/recbole/lib/python3.9/site-packages/recbole/evaluator/metrics.py", line 190, in metric_info
    iranks = np.zeros_like(pos_index, dtype=np.float)
  File "/opt/anaconda3/envs/recbole/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

Desktop (please complete the following information):

  • macOS
  • RecBole==1.1.1
  • Python==3.9
  • pytorch-lightning==1.5.10

I submitted a PR solving this issue:
fixing np.float support

@ElkanaBaris ElkanaBaris added the bug Something isn't working label Mar 26, 2023
@peteryang1031 peteryang1031 self-assigned this Mar 27, 2023
@peteryang1031
Copy link
Collaborator

Hi @ElkanaBaris , thank you for your attention. We have fix this issue in #1621.

@ElkanaBaris
Copy link
Contributor Author

still the issue persists when importing recbole as a library

@dabasmoti
Copy link

@ElkanaBaris - Did u solve it except changing it manually?

@dabasmoti
Copy link

@ElkanaBaris
Dont thanks me
I have the same issue
Running on version 1.1.1
Which is the latest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants