-
Notifications
You must be signed in to change notification settings - Fork 155
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
sbi.analysis
seems broken because np.string_
was removed in the NumPy 2.0 release.
#1189
Comments
I just installed the sbi-main branch directly, since I noticed that it differs from the one I got from pip, and So I guess the new NumPy version might require some research into the changelog to make sbi compatible with it. |
Hi @danielmk thanks for reporting this! I think we would rather try to adopt the required changes coming with If you would be willing to make a PR with the fixes that would be great! |
Ok, I will work on a PR according to the SciPy migration guide https://numpy.org/devdocs/numpy_2_0_migration_guide.html |
I just ran The errors I have been getting come from other packages. So far I have seen EDIT: It was Brian2 that installed NumPy 2.0.0 in the first place. |
Thanks for looking into the details. For the upcoming release I suggest we pin
|
Double checking,
So overall, this seems to be fixed and we do not need to pin For me |
The normal pip installation of sbi installs numpy 1.26.4 and sbi is working in that case. However, when I manually install numpy=2.0, tensorboard and pytensor are still broken (the tensorboard fix you linked is not in the release version yet, I guess). This is not a big issue, since there is no good reason to upgrade to numpy 2.0 right now. You even have to explicitly go through the conda-forge channel to get it. It was only an issue for me because I installed Brian2, which installed numpy 2.0, which in turn broke sbi for me. My fix was to manually downgrade numpy to 1.26.4 with So for me the issue is resolved, but maybe it is worth keeping the issue open until pytensor and tensorboard both have their fixes in the stable release, in case other people run into the same problem. |
I agree, thanks for clarifying. |
Describe the bug
import sbi.analysis
causes the following error:AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.
To Reproduce
I just made a fresh sbi environment and pip installed sbi
Python 3.10.14
sbi 0.22.0
numpy 2.0.0
import sbi.analysis
AttributeError:
np.string_was removed in the NumPy 2.0 release. Use
np.bytes_instead.
Additional context
I guess this means that sbi (at least the analysis module) is currently not compatible with the recent NumPy release. I could produce a fix or alternatively numpy<2.0.0 could be added to the pyproject file, in case the new numpy release requires some broader changes?
The text was updated successfully, but these errors were encountered: