alignn icon indicating copy to clipboard operation
alignn copied to clipboard

Python version>=3.9?

Open whyydsforever opened this issue 1 year ago • 7 comments

when I ran the code --python setup.py develop It turned out that Processing scipy-1.11.0rc2.tar.gz Writing /tmp/easy_install-7tv5fusw/scipy-1.11.0rc2/setup.cfg Running scipy-1.11.0rc2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7tv5fusw/scipy-1.11.0rc2/egg-dist-tmp-8nqf7m51 Traceback (most recent call last): File "/root/miniconda3/lib/python3.8/site-packages/setuptools/sandbox.py", line 152, in save_modules yield saved File "/root/miniconda3/lib/python3.8/site-packages/setuptools/sandbox.py", line 193, in setup_context yield File "/root/miniconda3/lib/python3.8/site-packages/setuptools/sandbox.py", line 254, in run_setup _execfile(setup_script, ns) File "/root/miniconda3/lib/python3.8/site-packages/setuptools/sandbox.py", line 43, in _execfile exec(code, globals, locals) File "/tmp/easy_install-7tv5fusw/scipy-1.11.0rc2/setup.py", line 33, in "ase", RuntimeError: Python version >= 3.9 required.

whyydsforever avatar Jun 22 '23 17:06 whyydsforever

it looks like newer versions of scipy require python 3.9 or newer

you might be able to downgrade scipy to a version that will work with 3.8, but I would recommend upgrading your python version to 3.10 if possible. (last I checked PyTorch had some compatibility issues with python 3.11)

bdecost avatar Jun 22 '23 18:06 bdecost

I saw that our README specifies python 3.8, so that will need to be updated...

if you're using anaconda, you should change the environment setup to conda create --name alignn python=3.10

also, if you are using CUDA, it's best to manually install the GPU versions of PyTorch and dgl before installing alignn

Assuming you're on linux and you want CUDA 11.8

conda activate alignn
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install -c dglteam/label/cu118 dgl

then you can do an in-place install of alignn:

git clone https://github.com/usnistgov/alignn && cd alignn
python -m pip install -e .

bdecost avatar Jun 22 '23 18:06 bdecost

One more thing that I recently encountered - in some of my code I'm hitting a possible CUDA bug in the latest version of dgl, so you may wish to install an older version (v1.0.2 does not have the aforementioned issue - you can get it with conda install -c dglteam/label/cu118 dgl==1.0.2.cu118)

bdecost avatar Jun 22 '23 18:06 bdecost

If it is possible just downgrade the scipy?

whyydsforever avatar Jun 22 '23 18:06 whyydsforever

If it is possible just downgrade the scipy?

it's probably possible, unless some other dependency requires a new version of scipy

bdecost avatar Jun 22 '23 18:06 bdecost

After I downgrade the scipy it seems to work, but still got some issues: Engine run is terminating due to exception: use_deterministic_algorithms() got an unexpected keyword argument 'warn_only' Traceback (most recent call last): File "/root/miniconda3/bin/train_folder.py", line 7, in exec(compile(f.read(), file, 'exec')) File "/root/alignn/alignn/train_folder.py", line 197, in train_for_folder( File "/root/alignn/alignn/train_folder.py", line 180, in train_for_folder train_dgl( File "/root/alignn/alignn/train.py", line 961, in train_dgl trainer.run(train_loader, max_epochs=config.epochs) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 906, in run return self._internal_run() File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 949, in _internal_run return next(self._internal_run_generator) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 1007, in _internal_run_as_gen self._handle_exception(e) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 645, in _handle_exception raise e File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 960, in _internal_run_as_gen self._fire_event(Events.STARTED) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/engine.py", line 432, in _fire_event func(*first, *(event_args + others), **kwargs) File "/root/miniconda3/lib/python3.8/site-packages/pytorch_ignite-0.5.0.dev20230622-py3.8.egg/ignite/engine/deterministic.py", line 196, in _init_run torch.use_deterministic_algorithms(True, warn_only=True) TypeError: use_deterministic_algorithms() got an unexpected keyword argument 'warn_only'

whyydsforever avatar Jun 22 '23 18:06 whyydsforever

can you share which version of PyTorch you have installed? I was able to make a clean python 3.8 environment with PyTorch 2.0.1 and DGL "1.0.2+cu118", and I had no issues running the train_folder.py example from the README

Here are the steps I used to set up the environment:

conda create --name alignn38 python=3.8
conda activate alignn38
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install scipy
conda install -c dglteam/label/cu118 dgl==1.0.2.cu118
git clone https://github.com/usnistgov/alignn && cd alignn
python -m pip install -e .

I still would encourage switching to python 3.10 because the 3.9 and 3.10 releases introduced a bunch of performance increases and much better error message formatting

bdecost avatar Jun 22 '23 19:06 bdecost