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] Crash when using cornac with Numpy 2.0 #628

Closed
quentinhaenn opened this issue Jun 25, 2024 · 4 comments · May be fixed by quentinhaenn/cornac#1
Closed

[BUG] Crash when using cornac with Numpy 2.0 #628

quentinhaenn opened this issue Jun 25, 2024 · 4 comments · May be fixed by quentinhaenn/cornac#1

Comments

@quentinhaenn
Copy link
Contributor

Description

Cornac cannot work with Numpy 2.0. Error message:
"A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'."

In which platform does it happen?

MacBook with ARM platform (M1)
MacOS 14.5
Python 3.12

How do we replicate the issue?

Simply install cornac using pip install cornac and having numpy 2.0.0, then run:
from cornac.data import Reader, Dataset

Rollback to numpy 1.26 solve the issue.

Expected behavior (i.e. solution)

Expected cornac to run with the new major version of Numpy.

@tqtg
Copy link
Member

tqtg commented Jun 26, 2024

Thanks for reporting the issue. We're currently working towards making Cornac compatible with Numpy 2.0. In the meantime, we can rollback to Numpy 1.xx as you've suggested.

@quentinhaenn
Copy link
Contributor Author

Thanks for the quick reply. I suggest pointing it out in installation process and in pyproject.toml or setup.py depending on which one you're using (with dependencies reporting numpy<=1.26until you make the proper migration to Numpy 2.0

Thank again !

@tqtg
Copy link
Member

tqtg commented Jun 26, 2024

We're working on that and it'll be fixed soon in #627

quentinhaenn added a commit to quentinhaenn/cornac that referenced this issue Jun 27, 2024
tqtg added a commit that referenced this issue Jul 5, 2024
* Fix issue #628 with '.A' stuff on csr_matrix

* Modifying requirements.txt for numpy and another .A

---------

Co-authored-by: tqtg <[email protected]>
@tqtg tqtg closed this as completed Jul 5, 2024
@darrylong
Copy link
Member

This has been fixed with the release of Cornac 2.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants