mir-group / nequip

NequIP is a code for building E(3)-equivariant interatomic potentials
https://www.nature.com/articles/s41467-022-29939-5
MIT License
564 stars 124 forks source link

🐛 [BUG] `InvalidVersion` in v0.6.0 #431

Closed janosh closed 1 day ago

janosh commented 1 month ago

Describe the bug

v0.6.0 is raising

packaging.version.InvalidVersion: Invalid version: ''

in atomate2 CI

stack trace ```py File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/atomate2/forcefields/md.py", line 333, in calculator return ase_calculator(self.force_field_name, **self.calculator_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/atomate2/forcefields/utils.py", line 439, in ase_calculator calculator = NequIPCalculator.from_deployed_model(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/nequip/ase/nequip_calculator.py", line 62, in from_deployed_model model, metadata = nequip.scripts.deploy.load_deployed_model( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/nequip/scripts/deploy.py", line 131, in load_deployed_model assert packaging.version.parse( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/packaging/version.py", line 54, in parse return Version(version) ^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/packaging/version.py", line 200, in __init__ raise InvalidVersion(f"Invalid version: '{version}'") packaging.version.InvalidVersion: Invalid version: '' ```

To Reproduce

Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

Additional context

was fine before v0.6.0

janosh commented 1 month ago

presumably caused by this line

https://github.com/mir-group/nequip/blob/3db69640fabb684db1e13ec56826c3cb6586fafc/nequip/utils/versions.py#L10-L15

Linux-cpp-lisp commented 2 weeks ago

Hi @janosh ,

Thanks for the bug report---I should be able to commit a fix for this, but likely the easiest fix at your end would just be to re-deploy the trained model you are using in the CI using 0.6.0 to get a file that isn't affected by the possible past bug I believe to be triggering this.

I didn't realize nequip was integrated in atomate2, out of curiosity what is it used for there?

janosh commented 2 weeks ago

thanks for the fix @Linux-cpp-lisp!

nequip was added to atomate2 by @jonathanschmidt1. i'm not an active nequip user myself (yet) but looks like atomate2 integration covers MD, relax and static jobs