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

Resolve Deprecated Numpy Attribute Error Introduced in Commit 99153902f47a2e7faedc69d3740fd173fbf7891d #10

Closed
eliseoe opened this issue Nov 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eliseoe
Copy link
Collaborator

eliseoe commented Nov 21, 2023

Error Message:
AttributeError: module 'numpy' has no attribute 'int'.

Description:
The commit with ID 9915390 has introduced issues related to the deprecation of np.int in NumPy, resulting in the mentioned attribute error. I believe this is because there is no compatibility with newer versions of NumPy. We should either agree on the same numpy version or resolve this for future versions.

Current Environment

  • NumPy: 1.25.2 (most recent is 1.26.2)
@eliseoe eliseoe added the bug Something isn't working label Nov 21, 2023
@eliseoe eliseoe self-assigned this Nov 21, 2023
@eliseoe
Copy link
Collaborator Author

eliseoe commented Nov 21, 2023

Issue Update: Identified Error in esn/validation.py - Commit 99153902f47a2e7faedc69d3740fd173fbf7891d

Error Location:

File: esn/validation.py
Line: 61-64

I believe the error stems from Integer which is imported from skopt.space. Looking for replacement now.

Code:

if param_names[param_idx] == "tikhonov":
    search_space[param_idx] = Integer(
        *grid_range[param_idx], name=param_names[param_idx]
    )

@eliseoe
Copy link
Collaborator Author

eliseoe commented Nov 22, 2023

Closing Comment:
Root cause stems from skopt/space/transformer.py where np.int is still used despite being deprecated.

Resolution Steps:

  1. Replace all instances of np.int with int in the file 'anaconda3\envs\myenv\Lib\site-packages\skopt\space\transformers.py'.
  2. Restart the kernel (or exit PyCharm and open it again).
  3. Run the code again.

This fixed the issue for me.

Closing this issue now.

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

1 participant