facebookresearch / esm

Evolutionary Scale Modeling (esm): Pretrained language models for proteins
MIT License
3.16k stars 627 forks source link

Torch module no longer supported #535

Open thype2000 opened 1 year ago

thype2000 commented 1 year ago

When running the ESMFold Structure Prediction test script from the site, after a clean install, get the following error.

ModuleNotFoundError: No module named 'torch._six'

The module was deprecated and removed from torch.

ronboger commented 1 year ago

getting the same error

johnnytam100 commented 1 year ago

getting the same error

mdlakic commented 1 year ago

It could be that you have a PyTorch that is too new. The ESM requirement is specifically listed as pytorch=1.12.*.

FinnOD commented 1 year ago

I have the same issue. It comes from deepspeed, who patched this in March, but ESM requires deepspeed==0.5.9. Would be nice if ESM worked with new torch versions but oh well. https://github.com/microsoft/DeepSpeed/issues/2845

naailkhan28 commented 1 year ago

On DeepSpeed compatibility: this is actually an issue with OpenFold - see here https://github.com/aqlaboratory/openfold/issues/276.

Replacing all occurrences of deepspeed.utils.is_initialized() with deepspeed.comm.comm.is_initialized() in openfold/model/primitives.py fixes the issue and allows you to use the latest DeepSpeed, so you could make those changes yourself. I've done this locally and I can use ESMFold with the PyTorch 2.0 and the latest DeepSpeed too.