atomistic-machine-learning / schnetpack-gschnet

G-SchNet extension for SchNetPack
MIT License
45 stars 8 forks source link

Version incompatibility #7

Closed Hanxiaoze closed 1 year ago

Hanxiaoze commented 1 year ago

... ... File "/home/zhou/anaconda3/envs/gschnet/lib/python3.11/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 347, in instantiate_node return _call_target(target, partial, args, kwargs, full_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/zhou/anaconda3/envs/gschnet/lib/python3.11/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target raise InstantiationException(msg) from e hydra.errors.InstantiationException: Error in call to target 'pytorch_lightning.trainer.trainer.Trainer': TypeError("Trainer.init() got an unexpected keyword argument 'track_grad_norm'") full_key: trainer

Hanxiaoze commented 1 year ago

Can anyone help?

NiklasGebauer commented 1 year ago

Hi @Hanxiaoze , thank you for reporting this problem! I think it is caused by pytorch_lightning>=2.0. I am sorry, the version restrictions in the setup.py currently lead to installation of 2.0, however, the schnetpack==2.0.1 package on PyPi does not yet support this version (the most recent version on the master branch does support it). I will try to initiate a new release of schnetpack for PyPi later today which should solve this problem. As a quick workaround, you can downgrade pytorch_lightning in your environment:

conda activate gschnet
pip install pytorch_lightning==1.9

This should solve the problem for now. I will update this issue when schnetpack==2.0.2 is available. Please let me know whether this works for you.

Best regards, Niklas

Hanxiaoze commented 1 year ago

Thank you Dr.Niklas, I took your advice, use this version, now is running very well: setup( name="schnetpack-gschnet", packages=find_packages("src"), package_dir={"": "src"}, version="0.1", author="Niklas Gebauer", scripts=[], include_package_data=True, install_requires=[ "schnetpack>=2.0.0.dev0", "torch==2.0.0", "pytorch_lightning==1.9.0", "hydra-core==1.3.2", "hydra-colorlog==1.2.0", "numpy", "ase==3.22.1", "torchmetrics", "h5py", "tqdm", "pyyaml", "pre-commit", "black", ], ) ( python==3.11.3, ubuntu==22.04, RTX 3080Ti) I'm really appreciate your help! Thanks

NiklasGebauer commented 1 year ago

Perfect, glad I could help!

I will leave this open until we have released the updated schnetpack version in case other people run into similar issues.

NiklasGebauer commented 1 year ago

schnetpack has now been updated to v2.0.2, which works with the most up-to-date pytorch_lightning. This fixes the issues with the installation.