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

The numpy version in the installation of py4dstem-aiml #675

Open
PhysXu opened this issue Aug 18, 2024 · 4 comments
Open

The numpy version in the installation of py4dstem-aiml #675

PhysXu opened this issue Aug 18, 2024 · 4 comments

Comments

@PhysXu
Copy link

PhysXu commented Aug 18, 2024

Hi, all,

I encountered an issue when installing the py4dstem with AI/ML functionality by following the steps below:

conda update conda
conda create -n py4dstem-aiml
conda activate py4dstem-aiml
conda install -c conda-forge cudatoolkit=11.0 cudnn=8.1 cupy 
pip install "py4dstem[aiml-cuda]"

The snapshot of this issue:
image

and I check the version of the installed python, 4dstem and numpy, please see below:
image

Is the version of numpy too high?

@chiahao3
Copy link

Not from the py4DSTEM team so just my 2 cents. It's been a month since the post so you might've solve it already.
I'll suggest restrict your numpy to be < 2.0 during the conda install. Numpy 2.0 was released a couple months back and it will take a while for cupy and scipy to keep up. You might need a newer python as well, probably 3.10 or 3.11. I'm suprised that conda provides a 3.9.19 to you. Overall speaking, I think you just need to find a sweet combination of python, numpy, and cupy. If you're feeling adventerous, you may experiment with different version of cudatoolkit as well.

@sezelt
Copy link
Member

sezelt commented Sep 27, 2024

I tried this on my machine, and with cupy 13.3.0 and numpy 2.0.2 it is possible to import py4DSTEM. So it seems that whatever incompatibility was present has been resolved by upstream packages.

It does seem odd that py4DSTEM 0.12.8 is the version that it picks. The aiml-cuda option is still in the setup.py, so I'm not sure why newer releases don't get chosen. Is there some step in the packaging process we've been skipping? In any case, this may be the latest version where the aiml features worked, so perhaps it's intentional, but I'm still confused at what step the limit is imposed.

@PhysXu
Copy link
Author

PhysXu commented Dec 3, 2024

I am still confused by this issue.
Even though I installed a very new python (3.11 or 3.12), the pip install "py4dstem[aiml-cuda]" still installed a very old version of py4dstem (0.12.8).
image

If I want to use the GPU-version of py4dstem, what is the standard steps of the installation?

@sezelt
Copy link
Member

sezelt commented Dec 3, 2024

The aiml version of py4DSTEM is only necessary if you want to use the FCU-net (https://www.nature.com/articles/s41524-022-00939-9). If you want to use the other GPU features (ptychography, disk detection, ACOM, etc), just install py4DSTEM normally and also specify cupy:
conda create -n py4dstem -c conda-forge py4dstem cupy
Conda should take care of all the other details.

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

No branches or pull requests

3 participants