mheinzinger / ProstT5

Bilingual Language Model for Protein Sequence and Structure
MIT License
147 stars 13 forks source link

Issue downloading model weights #10

Closed szimmerman92 closed 3 months ago

szimmerman92 commented 4 months ago

Hi,

Sorry for opening another issue. I was wondering if you changed the model weights recently?

For some reason after running predict_3Di_encoderOnly.py the cnn_chkpnt/model.pt file is not an actual weight file, but instead it is a bunch of HTML code. See the atttachment (I changed the name from model.pt to model.txt because it wouldn't let me upload it otherwise). Oddly I am having a difficult time reproducing this error, sometimes it downloads the file correctly, sometimes it does not.

As a result, when I run predict_3Di_encoderOnly.py I get the following error.

Downloading spiece.model: 100%|██████████| 238k/238k [00:00<00:00, 133MB/s] Downloading added_tokens.json: 100%|██████████| 283/283 [00:00<00:00, 145kB/s] Downloading (…)cial_tokens_map.json: 100%|██████████| 2.20k/2.20k [00:00<00:00, 1.48MB/s] Downloading tokenizer_config.json: 100%|██████████| 2.40k/2.40k [00:00<00:00, 1.93MB/s] Downloading: https://rostlab.org/~deepppi/prostt5/cnn_chkpnt/model.pt Traceback (most recent call last): File "/n/scratch/users/s/sez10/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 383, in main() File "/n/scratch/users/s/sez10/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 378, in main output_probs, File "/n/scratch/users/s/sez10/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 194, in get_embeddings predictor = load_predictor() File "/n/scratch/users/s/sez10/Alzheimer_project/ProstT5/scripts/predict_3Di_encoderOnly.py", line 173, in load_predictor state = torch.load(checkpoint_p, map_location=device) File "/home/sez10/miniconda3_2/lib/python3.7/site-packages/torch/serialization.py", line 795, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/home/sez10/miniconda3_2/lib/python3.7/site-packages/torch/serialization.py", line 1002, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

Thank you all for the great tool!

Best Regards, Sam

model.txt

mheinzinger commented 4 months ago

Thanks for the heads-up! Indeed we have ongoing server issues. As a quick-fix I simply added the CNN weights to this model repo and adjusted the download link here: https://github.com/mheinzinger/ProstT5/blob/main/scripts/predict_3Di_encoderOnly.py#L162 Feel free to close if this solves your issue