facebookresearch / esm

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

Issue with ESM_advanced Colab #399

Open jfbazan opened 1 year ago

jfbazan commented 1 year ago

I ran into a fairly new issue with running the ESM_advanced Colab with a ~120 aa sequence (that predicts well with the ESMfold Colab) that seems to happen after the prediction module has run (because I can see the message: CPU times: user 1.9 ms, sys: 988 µs, total: 2.89 ms, Wall time: 2.76 ms..). The error message I get as program crashes is the following. Thx in advance for your expert help.

length 0

IndexError Traceback (most recent call last)

in [/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py](https://localhost:8080/#) in decorate_context(*args, **kwargs) 25 def decorate_context(*args, **kwargs): 26 with self.clone(): ---> 27 return func(*args, **kwargs) 28 return cast(F, decorate_context) 29 5 frames [/usr/local/lib/python3.7/dist-packages/esm/esmfold/v1/esmfold.py](https://localhost:8080/#) in _af2_idx_to_esm_idx(self, aa, mask) 91 def _af2_idx_to_esm_idx(self, aa, mask): 92 aa = (aa + 1).masked_fill(mask != 1, 0) ---> 93 return self.af2_to_esm[aa] 94 95 def _compute_language_model_representations(self, IndexError: tensors used as indices must be long, byte or bool tensors and at the bottom TypeError Traceback (most recent call last) [](https://localhost:8080/#) in 60 return plt 61 ---> 62 plot_confidence(best_output, Ls=lengths, dpi=dpi) 63 plt.show() [](https://localhost:8080/#) in plot_confidence(output, Ls, dpi) 17 18 def plot_confidence(output, Ls=None, dpi=100): ---> 19 O = parse_output(output) 20 if "lm_contacts" in O: 21 plt.figure(figsize=(20,4), dpi=dpi) in parse_output(output) TypeError: 'NoneType' object is not subscriptable