sokrypton / sokrypton/ColabFold
Error with RosettaFold2 Setup
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 2.9k
- Forks
- 747
- PR merge metrics
- No merged PRs in 30d
Description
When running RosettaFold2 setup I get next error:
UnpicklingError Traceback (most recent call last)
in
/content/RoseTTAFold2/network/predict.py in
6 from torch.utils import data
7 from parsers import parse_a3m, read_templates, read_template_pdb, parse_pdb
----> 8 from RoseTTAFoldModel import RoseTTAFoldModule
9 import util
10 from collections import namedtuple
9 frames
/usr/local/lib/python3.11/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
1468 )
1469 except pickle.UnpicklingError as e:
-> 1470 raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
1471 return _load(
1472 opened_zipfile,
UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL builtins.slice was not an allowed global by default. Please use torch.serialization.add_safe_globals([slice]) or the torch.serialization.safe_globals([slice]) context manager to allowlist this global if you trust this class/function.
Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with network/predict.py and the RoseTTAFoldModel import shown in the traceback, then review the torch.load failure and the linked PyTorch serialization guidance. Reproduce the setup with the reported Python 3.11 and PyTorch 2.6 environment, checking the checkpoint source before changing loading behavior. Done means the RosettaFold2 setup completes without this UnpicklingError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter, python, pytorch
- Domain
- bioinformatics, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100