Rappsilber-Laboratory / AlphaLink2

AlphaLink2: Integrating crosslinking MS data into Uni-Fold-Multimer
Creative Commons Attribution 4.0 International
42 stars 11 forks source link

During prediction step, PytorchStreamReader failed reading zip archive: failed finding central directory #26

Open decortja opened 1 week ago

decortja commented 1 week ago

Hi again,

Thank you for your help so far. The script is running successfully through the MSA step for me. At the prediction on GPU step, I get the following error:

start to load params ./alphalink_weights.pt
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-25-da14335aba1a>](https://localhost:8080/#) in <cell line: 5>()
      3 from unifold.colab.model import colab_inference
      4 
----> 5 best_result = colab_inference(
      6     target_id=target_id,
      7     data_dir=output_dir,

2 frames
[/usr/local/lib/python3.10/dist-packages/unifold/colab/model.py](https://localhost:8080/#) in colab_inference(target_id, data_dir, param_dir, output_dir, is_multimer, max_recycling_iters, num_ensembles, times, manual_seed, device)
     44     model = AlphaFold(config)
     45     print("start to load params {}".format(param_path))
---> 46     state_dict = torch.load(param_path)["ema"]["params"]
     47     state_dict = {".".join(k.split(".")[1:]): v for k, v in state_dict.items()}
     48     model.load_state_dict(state_dict)

[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
   1002             orig_position = opened_file.tell()
   1003             overall_storage = None
-> 1004             with _open_zipfile_reader(opened_file) as opened_zipfile:
   1005                 if _is_torchscript_zip(opened_zipfile):
   1006                     warnings.warn("'torch.load' received a zip file that looks like a TorchScript archive"

[/usr/local/lib/python3.10/dist-packages/torch/serialization.py](https://localhost:8080/#) in __init__(self, name_or_buffer)
    454 class _open_zipfile_reader(_opener):
    455     def __init__(self, name_or_buffer) -> None:
--> 456         super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
    457 
    458 

RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

How can this issue be resolved? Thanks again. For reference, I was testing the script with: FASTA: from 2W9Z on PDB Crosslink: 22 A 133 B 0.2

lhatsk commented 1 week ago

Hi,

I can't reproduce this. Sometimes there are hiccups in ColabFold, deleting and restarting the runtime usually resolves this. Your error looks like the weights weren't properly downloaded or for some reason no longer accessible.