-
Notifications
You must be signed in to change notification settings - Fork 287
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
Support Numpy 2.0 #1558
Comments
It looks like torchvision 0.19 will be compatible with numpy 2.0 (source: pytorch/vision#8460 (comment)). Let's require numpy 1.x for now. |
Why can't we support both numpy 1 and 2 as soon as possible? Why do we need to wait for other dependencies? Seems like it's a simple fix. |
Hey @adamjstewart, thanks for the feedback. We can already migrate the library to NumPy 2.0 as in #1561 but the problem of broken upstream libraries remains. In particular, torchvision 0.18.0 is only 98% compatible (see the tracker issue numpy/numpy#26191) and it appears that we are affected by the remaining two percent: Applying color jitter results in the following error (failing GitHub action):
|
It's not possible for your tests to pass without waiting for torchvision, but it is possible for the next release to be compatible with numpy 2 (futureproof). This way, as soon as torchvision makes a new release, the last month of lightly releases will already immediately support numpy 2. |
We appreciate your input. However, relaxing the numpy version requirement again will lead to more broken installations, which we want to avoid. We've chosen to keep numpy constrained to |
For the moment, there is no torchvision version compatible with numpy 2 thus we restricted the requirements to not use numpy 2: #1562 Once a compatible torchvision version is released, we can have a look again. |
Would it make sense to keep this issue open for tracking purposes? |
@jakirkham good point, will reopen |
Looks like this was closed. Does this mean it was implemented? |
The PR is not yet merged |
Now we just need a new release 😄 |
Soon soon 😇 Should be out in <2 weeks. |
No rush, lightly's release schedule is already faster than most. This is partly why I was so adamant about supporting numpy 2 immediately and letting torchvision deal with complaints about numpy 2 incompatibility |
Ah sorry. Think I misunderstood |
Numpy 2.0 is now be fully supported with the 1.5.11 release. |
Unfortunately torch/torchvision still don't support numpy 2 on Windows in the latest release, but at least we can use this on macOS/Linux. |
Thanks for the heads up, was not aware of this! |
Conda-forge still needs to be updated with NumPy 2 support: conda-forge/lightly-feedstock#20 |
Released 1.5.12 on conda as well with Numpy 2 support |
Error using lightly with numpy 2.0
Numpy 2.0.0 was released on June 16th 2024 and does not work with lightly.
Using numpy==2.0.0 and lightly==1.5.6 and python==3.10.8:
Reproduce
Run in a new venv, such that numpy 2.0 is installed:
Workaround
Just install an older numpy version, e.g. using
pip install numpy==1.26
.The text was updated successfully, but these errors were encountered: