-
Notifications
You must be signed in to change notification settings - Fork 83
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
Does ALIGNNTL works with ALIGNN 2024.2.4 #155
Comments
hi - I think the ALIGNNTL project is more of a fork of ALIGNN than a project that depends on this repository. There is a copy of the alignn source tree under ALIGNNTL/FineTuning so to run the demo that you are asking about, I think you should do something like this git clone https://github.com/NU-CUCIS/ALIGNNTL/FineTuning
cd ALIGNNTL/FineTuning
python alignn/train.py --root_dir "../examples" --config "../examples/config_example.json" --id_prop_file "id_prop.csv" --output_dir=model this would run the training script in the ALIGNNTL repository (https://github.com/NU-CUCIS/ALIGNNTL/blob/main/FineTuning/alignn/train.py), not the training entry point in the v2024.2.4 ALIGNN that you have installed maybe @GuptaVishu2002 can confirm |
Hi, thank you for your answer!
which I wasn't able to install neither using pip nor conda. |
if you mean this line, that is not a package dependency, it's the version of alignn that this project was forked from from what I can tell, ALIGNNTL is not really meant to be an installable package, it's more research code that seems meant to be run directly from the source directory I think if you want to reproduce the ALIGNNTL methods the most straightforward thing would be to create a fresh environment and install the dependencies from the ALIGNNTL list - I recommend first installing the stable releases of PyTorch and DGL following the instructions for each of those packages to ensure you get the right CUDA versions and such, then install the other dependencies with python -m pip install numpy scipy Jarvis-tools scikit-learn matplotlib tqdm pandas pytorch-ignite "pydantic<2.0" flake8 pycodestyle pydocstyle pyparsing you have to pin pydantic to v1 since pydantic 2.x has breaking changes that affect the version of alignn this project is forked from don't install alignn in this repository since you will be directly running the ALIGNNTL version https://github.com/NU-CUCIS/ALIGNNTL/blob/main/FineTuning/alignn/train.py then you can run the example like I suggested before. I had to make sure ALIGNNTL/FineTuning was on my git clone https://github.com/NU-CUCIS/ALIGNNTL
cd ALIGNNTL/FineTuning
PYTHONPATH=. python alignn/train.py --root_dir "../examples" --config "../examples/config_example.json" --id_prop_file "id_prop.csv" --output_dir=model hopefully that works for you, the alternative is a bit more work of figuring out the cleanest way to incorporate the functionality of this project back into the upstream alignn repo |
Thank you for the tip regarding PYTHONPATH, running the script in this way indeed does not require ALIGNN to be installed. However, if I run In addition, I've checked the availability of CUDA by running |
I'm not sure what to make of the I noticed that it seems like you have both If that's the problem, it might work if you remove the CPU version of the package. If you want to use more current library versions, I would recommend installing the stable PyTorch with conda first, then installing the stable version of dgl with the matching CUDA version
then install the other dependencies I've found that it can take a bit of experimenting to make sure the PyTorch, dgl, and CUDA versions are all compatible, and sometimes there are point releases of dgl that you have to avoid so you might have to downgrade dgl by a few point releases. I have an environment that I know works with torch 2.1.2 and dgl 2.0.0+cu118, but I don't think I've tried the current dgl release yet |
Dear developers!
Actually, my request belongs to this reporistory for the ALIGNN transfer learning project, but since I have not received a reply on the issue there, I thought I could try to obtain it here.
I have an installed and proper working ALIGNN v. 2024.2.4. I cloned the ALIGNNTL repository and trying to reproduce the FineTuning example, first of all, I face that the train_folder.py script (which is suggested to run ) does not contain all_models = {...} required for the TL. Then I found that train.py script contains this code, so I tried to run
python alignn/train.py --root_dir "../examples" --config "../examples/config_example.json" --id_prop_file "id_prop.csv" --output_dir=model
but get the following errors
from .named_optimizer import _NamedOptimizer File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/optim/named_optimizer.py", line 11, in <module> from torch.distributed.fsdp import FullyShardedDataParallel as FSDP File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/fsdp/__init__.py", line 1, in <module> from ._flat_param import FlatParameter as FlatParameter File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/fsdp/_flat_param.py", line 30, in <module> from torch.distributed.fsdp._common_utils import ( File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/fsdp/_common_utils.py", line 35, in <module> from torch.distributed.fsdp._fsdp_extensions import FSDPExtensions File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/fsdp/_fsdp_extensions.py", line 8, in <module> from torch.distributed._tensor import DeviceMesh, DTensor File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/_tensor/__init__.py", line 6, in <module> import torch.distributed._tensor.ops File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/_tensor/ops/__init__.py", line 2, in <module> from .embedding_ops import * # noqa: F403 File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/_tensor/ops/embedding_ops.py", line 8, in <module> import torch.distributed._functional_collectives as funcol File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/_functional_collectives.py", line 12, in <module> from . import _functional_collectives_impl as fun_col_impl File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/distributed/_functional_collectives_impl.py", line 36, in <module> from torch._dynamo import assume_constant_result File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/_dynamo/__init__.py", line 2, in <module> from . import convert_frame, eval_frame, resume_execution File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 40, in <module> from . import config, exc, trace_rules File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/_dynamo/exc.py", line 11, in <module> from .utils import counters File "/home/anton/miniconda3/envs/alignn/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 5, in <module> import cProfile File "/home/anton/miniconda3/envs/alignn/lib/python3.10/cProfile.py", line 23, in <module> run.__doc__ = _pyprofile.run.__doc__ AttributeError: module 'profile' has no attribute 'run'
From the setup.py I see that the expected version of ALIGNN is 2021.11.16, but is it mandatory and this is the cause of the problems? If yes, aren't you going to update the ALIGNNTL code to support the actual version of ALIGNN?
Best regards,
Anton.
The text was updated successfully, but these errors were encountered: