aqlaboratory / openfold

Trainable, memory-efficient, and GPU-friendly PyTorch reproduction of AlphaFold 2
Apache License 2.0
2.84k stars 550 forks source link

using alphafold weights - Expected hasRecord("Version") to be true #476

Closed maartensandbox closed 3 months ago

maartensandbox commented 4 months ago

I downloaded the alphafold weights from https://storage.googleapis.com/alphafold/alphafold_params_2022-12-06.tar

Running the docker with

docker run \
--gpus all \
-v /scratch:/data \
-v /scratch/alphafold_database:/database \
-ti openfold \
python3 /opt/openfold/run_pretrained_openfold.py \
/data/fasta_dir \
/database/pdb_mmcif/mmcif_files/ \
--use_precomputed_alignments /data/martins_data/alignment_data/alignments \
--uniref90_database_path /database/uniref90/uniref90.fasta \
--mgnify_database_path /database/mgnify/mgy_clusters_2022_05.fa \
--pdb70_database_path /database/pdb70/pdb70 \
--uniclust30_database_path /database/uniclust30/uniclust30_2018_08/uniclust30_2018_08 \
--output_dir /data \
--bfd_database_path /database/bfd/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt \
--model_device cuda:0 \
--jackhmmer_binary_path /opt/conda/bin/jackhmmer \
--hhblits_binary_path /opt/conda/bin/hhblits \
--hhsearch_binary_path /opt/conda/bin/hhsearch \
--kalign_binary_path /opt/conda/bin/kalign \
--openfold_checkpoint_path /database/alphafold_params/params_model_1.npz \
--config_preset model_1

results in

==========
== CUDA ==
==========

CUDA Version 11.3.1

Container image Copyright (c) 2016-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

/opt/conda/lib/python3.9/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.26.4
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
[2024-08-02 10:10:26,735] [INFO] [real_accelerator.py:161:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Traceback (most recent call last):
  File "/opt/openfold/run_pretrained_openfold.py", line 498, in <module>
    main(args)
  File "/opt/openfold/run_pretrained_openfold.py", line 288, in main
    for model, output_directory in model_generator:
  File "/opt/openfold/openfold/utils/script_utils.py", line 97, in load_models_from_command_line
    d = torch.load(ckpt_path)
  File "/opt/conda/lib/python3.9/site-packages/torch/serialization.py", line 705, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "/opt/conda/lib/python3.9/site-packages/torch/serialization.py", line 242, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: Expected hasRecord("version") to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)
jnwei commented 3 months ago

Hi, thanks for your interest in OpenFold.

To make predictions using alphafold weights, please specify the parameter path with the flag jax_param_path instead of openfold_checkpoint_path