mheinzinger / ProstT5

Bilingual Language Model for Protein Sequence and Structure
MIT License
183 stars 15 forks source link

AttributeError: 'T5EncoderModel' object has no attribute 'full' #6

Closed szimmerman92 closed 10 months ago

szimmerman92 commented 10 months ago

Hi,

Thank you for the great tool. When I run the script predict_3Di_encoderOnly.py in full precision mode I get the following error "AttributeError: 'T5EncoderModel' object has no attribute 'full'

Downloading spiece.model: 100%|██████████| 238k/238k [00:00<00:00, 78.0MB/s] Downloading added_tokens.json: 100%|██████████| 283/283 [00:00<00:00, 129kB/s] Downloading (…)cial_tokens_map.json: 100%|██████████| 2.20k/2.20k [00:00<00:00, 1.00MB/s] Downloading tokenizer_config.json: 100%|██████████| 2.40k/2.40k [00:00<00:00, 1.10MB/s] Downloading: https://rostlab.org/~deepppi/prostt5/cnn_chkpnt/model.pt Traceback (most recent call last): File "/n/scratch3/users/s/sez10/_RESTORE/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 383, in main() File "/n/scratch3/users/s/sez10/_RESTORE/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 378, in main output_probs, File "/n/scratch3/users/s/sez10/_RESTORE/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 201, in get_embeddings model = model.full() File "/home/sez10/miniconda3_2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1270, in getattr type(self).name, name)) AttributeError: 'T5EncoderModel' object has no attribute 'full'

Specifically the code I am running is the following: python predict_3Di_encoderOnly.py --input test.fasta --output test_res.fasta --model prstt5_model --half 0

Thanks again.

Best, Sam

mheinzinger commented 10 months ago

Hi Sam,

thanks a lot for the heads-up. I have replaced the '.full()' by '.to(torch.float32)' which solves the issue on my end.

szimmerman92 commented 10 months ago

Thank you very much. That worked perfectly.

While I am here, can I ask you if there is any difference in accuracy in creating 3DI sequences from amino acids when running predict_3DI_encoderOnly.py compared to translate.py?

Thanks again!

Sam

mheinzinger commented 10 months ago

Yes, indeed there will be a difference. Unfortunately, I still did not manage to update the bioRxiv version of the paper to have a proper description of the difference but in a nutshell:

szimmerman92 commented 10 months ago

Very interesting. Thank you for the detailed response!