facebookresearch / esm

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

What model is needed for regression_data in esm.pretrained.load_model_and_alphabet_local? #103

Closed xmhh closed 3 years ago

xmhh commented 3 years ago

Bug description Use esm.pretrained.load_model_and_alphabet_local( 'esm1_t12_85M_UR50S.pt'), i need to load esm1_t12_85M_UR50S-contact-regression.pt, but in fact this is not provided.

Logs image

Output goes here

Additional context If you want to load the local esm model, besides the esm1_t12_85M_UR50S.pt you provided, do you need any regression model? What is the meaning of regression_data in your code esm.pretrained.load_model_and_alphabet_local .

xmhh commented 3 years ago

The 0.3.1 version uses the try except statement, so there is no regression-related model in the load and no error will be reported, but I still want to know what this regression does?

tomsercu commented 3 years ago

Yes you need a second file to load the regression weights, aka weights of the ContactPredictionHead. Failure was silent before, but better to be explicit. If you load via esm.pretrained.esm1_t12_85M_UR50S(), the regression weights will be downloaded to ~/.cache/torch/hub/checkpoints. Let me know if that helps?

xmhh commented 3 years ago

Yes you need a second file to load the regression weights, aka weights of the ContactPredictionHead. Failure was silent before, but better to be explicit. If you load via esm.pretrained.esm1_t12_85M_UR50S(), the regression weights will be downloaded to ~/.cache/torch/hub/checkpoints. Let me know if that helps? Yes, what you said is a useful solution. If I don’t want to download this model from https://dl.fbaipublicfiles.com/fair-esm/regression, can you provide it directly like other training models? just like download link below. image

Of course, we can also know his address from your source code, but it may be slightly inconvenient. Thanks for you reply. : )

tomsercu commented 3 years ago

Ah yes - we should update that table with link to both model weights and regression. For now: This is the code which points to https://dl.fbaipublicfiles.com/fair-esm/regression/{model_name}-contact-regression.pt

tomsercu commented 3 years ago

@xmhh is your problem solved?

Mountain-White commented 3 years ago

Sry for bothering,but I can‘t run your esm-1v code for losing contact-regression.pt. I try to download from pretrained:load_regression_hub(), but failed again.However, I can download esm-1b.Did you forget to upload or ...?

tomsercu commented 3 years ago

@Mountain-White esm-1v does not have contact-regression.pt because it is not optimal for that task (rather it is best for variant prediction). Does that answer your question?

Mountain-White commented 3 years ago

@Mountain-White esm-1v does not have contact-regression.pt because it is not optimal for that task (rather it is best for variant prediction). Does that answer your question?

thx ,the problem is solved.