luigibonati / mlcolvar

A unified framework for machine learning collective variables for enhanced sampling simulations
MIT License
91 stars 24 forks source link

The code is not compatible with torch 2.3, but is set to require the latest torch #143

Closed Alexander-the-Evil closed 2 months ago

Alexander-the-Evil commented 2 months ago

Pytorch v2.3.0 no longer defines function _accumulate in torch/_utils.py. The function is called from mlcolvar/data/datamodule.py.

Either the code needs to be changed to be executable with the new pytorch, or an older pytorch should be used in requirements.

EnricoTrizio commented 2 months ago

Ciao Alexander, thanks, we also noticed that, and it should have been fixed in #129. The tests on the main branch are indeed running fine and they require torch 2.3. To be sure, are you using an older version of the library with the new pytorch? For example, the PyPi version is bound to the latest stable release.

luigibonati commented 2 months ago

We should make a bugfix in the pypi version

luigibonati commented 2 months ago

@Alexander-the-Evil I released a new version on PyPI which should fix the problem, you can try installing it again

https://pypi.org/project/mlcolvar/1.1.1/#description

Alexander-the-Evil commented 2 months ago

Hi Enrico, hi Luigi, thank you! Yes, the issue was with the PyPi version. After that, I used locally installable version and it worked fine. I also believe that this issue concerns tutorial colabs, now the only way to use them is to manually add lines to install pytorch 2.2.0. But it is all solvable, just a small nuicance. Thank you for the fix! Alex

EnricoTrizio commented 2 months ago

Thank you Alexander for making us notice it! Thanks also to @luigibonati for addressing the issue.