esm icon indicating copy to clipboard operation
esm copied to clipboard

Only CPU Malfunction -- HF Colab Notebook

Open coopersvajda opened this issue 3 years ago • 1 comments

Hello, I am trying to utilize ESM as made available in the HuggingFace Colab Notebook. I do not have a local GPU to use, so have been attempting the only CPU mode. The first issue is in preparing the model and tokenizer where it states " If using GPU, use model.cuda() to transfer the model to GPU." and the code below is:

from transformers import AutoTokenizer, EsmForProteinFolding

tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1") model = EsmForProteinFolding.from_pretrained("facebook/esmfold_v1", low_cpu_mem_usage=True)

model = model.cuda()**

To get around this, I simply removed the "model = model.cuda()" and the code ran fine. Next, down the line, I got to the Tokenization step which requires a GPU:

tokenized_input = tokenized_input.cuda()

Obviously when ran the error of "NO GPU" was displayed. So I went ahead and tried to run actual prediction lines:

import torch

with torch.no_grad(): output = model(tokenized_input)**

This displayed the following error:

RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'

So how are you supposed to run this sheet without a GPU? Is there something in the tokenization stage I should alter to provide good inputs for the prediction model?

coopersvajda avatar Jan 05 '23 23:01 coopersvajda

  • This might help you? #353

chAwater avatar Aug 03 '23 10:08 chAwater