esm icon indicating copy to clipboard operation
esm copied to clipboard

AttributeError: 'ESMProteinError' object has no attribute 'hidden_states'

Open jinlong-abc opened this issue 9 months ago • 5 comments


AttributeError Traceback (most recent call last) Cell In[58], line 5 1 import torch 3 # we'll summarize the embeddings using their mean across the sequence dimension 4 # which allows us to compare embeddings for sequences of different lengths ----> 5 all_mean_embeddings = [ 6 torch.mean(output.hidden_states, dim=-2).squeeze() for output in outputs 7 ] 9 # now we have a list of tensors of [num_layers, hidden_size] 10 print("embedding shape [num_layers, hidden_size]:", all_mean_embeddings[0].shape)

Cell In[58], line 6 1 import torch 3 # we'll summarize the embeddings using their mean across the sequence dimension 4 # which allows us to compare embeddings for sequences of different lengths 5 all_mean_embeddings = [ ----> 6 torch.mean(output.hidden_states, dim=-2).squeeze() for output in outputs 7 ] 9 # now we have a list of tensors of [num_layers, hidden_size] 10 print("embedding shape [num_layers, hidden_size]:", all_mean_embeddings[0].shape)

AttributeError: 'ESMProteinError' object has no attribute 'hidden_states'

jinlong-abc avatar Mar 18 '25 09:03 jinlong-abc

I had the same error, any update on how to solve it?

SakshiTaware avatar Mar 24 '25 18:03 SakshiTaware

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

jinlong-abc avatar Mar 24 '25 18:03 jinlong-abc

I met the same error, can it be solved now?

SHG369 avatar Apr 07 '25 02:04 SHG369

same problem

AttributeError Traceback (most recent call last) Cell In[14], line 6 1 import torch 3 # we'll summarize the embeddings using their mean across the sequence dimension 4 # which allows us to compare embeddings for sequences of different lengths 5 all_mean_embeddings = [ ----> 6 torch.mean(output.hidden_states, dim=-2).squeeze() for output in outputs 7 ] 9 # now we have a list of tensors of [num_layers, hidden_size] 10 print("embedding shape [num_layers, hidden_size]:", all_mean_embeddings[0].shape)

AttributeError: 'ESMProteinError' object has no attribute 'hidden_states'

Sparadox001 avatar Apr 10 '25 02:04 Sparadox001

Same here

HansJWolters avatar Apr 11 '25 21:04 HansJWolters