ColabFold icon indicating copy to clipboard operation
ColabFold copied to clipboard

ESMFold Notebook fails with "No module named openfold" error message

Open coliva92 opened this issue 2 years ago • 5 comments

I simply opened the ESMFold notebook and clicked on Runtime > Run all. When the execution reaches the cell titled "run ESMFold", it fails and displays the following error message:

ModuleNotFoundError                       Traceback (most recent call last)
<timed exec> in <module>

[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in load(f, map_location, pickle_module, weights_only, **pickle_load_args)
    787                     except RuntimeError as e:
    788                         raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
--> 789                 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
    790         if weights_only:
    791             try:

2 frames
[/usr/local/lib/python3.10/dist-packages/esm/esmfold/v1/esmfold.py](https://localhost:8080/#) in <module>
      9 import torch.nn as nn
     10 from omegaconf import MISSING
---> 11 from openfold.data.data_transforms import make_atom14_masks
     12 from openfold.np import residue_constants
     13 from openfold.utils.loss import compute_predicted_aligned_error, compute_tm

ModuleNotFoundError: No module named 'openfold'

This bug might be similar to #509.

coliva92 avatar Dec 18 '23 17:12 coliva92

Did you find a solution to this problem? I'm having the same problem.

yuhahayuhaha avatar Dec 26 '23 01:12 yuhahayuhaha

I think I finally fixed it! Please try gain.

In short: esmfold uses openfold google colab updated to cuda12 only pytorch2 is available for cuda12 openfold was compiled with pytorch1, and c++14 to force openfold to use pytorch2/cuda12, all you have to do (in openfold) is: image

sokrypton avatar Dec 28 '23 19:12 sokrypton

I forked the openfold repo and made the change you suggested but I am still having the error. I changed the install to my fork as well prior to the error.

commit = "1e794900c99d0845aeb30e9be01a053403f8928d"
    os.system(f"pip install openfold@git+https://github.com/LaneYahtzee/openfold.git@{commit}")

After installing, I am still having this error.

ModuleNotFoundError                       Traceback (most recent call last)
<timed exec> in <module>

[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in load(f, map_location, pickle_module, weights_only, **pickle_load_args)
    787                     except RuntimeError as e:
    788                         raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
--> 789                 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
    790         if weights_only:
    791             try:

2 frames
[/usr/local/lib/python3.10/dist-packages/esm/esmfold/v1/esmfold.py](https://localhost:8080/#) in <module>
      9 import torch.nn as nn
     10 from omegaconf import MISSING
---> 11 from openfold.data.data_transforms import make_atom14_masks
     12 from openfold.np import residue_constants
     13 from openfold.utils.loss import compute_predicted_aligned_error, compute_tm

ModuleNotFoundError: No module named 'openfold'

LaneYahtzee avatar Jan 16 '24 21:01 LaneYahtzee

You might need to remove the {commit} part. As that I'm guessing doesn't exist in your branch

sokrypton avatar Jan 16 '24 21:01 sokrypton

That did not work for me unfortunately.

LaneYahtzee avatar Jan 17 '24 02:01 LaneYahtzee