(igfold) dell:~/Documents/SARS_CoV$ python Igfold.py
/home/dell/.local/lib/python3.10/site-packages/Bio/pairwise2.py:278: BiopythonDeprecationWarning: Bio.pairwise2 has been deprecated, and we intend to remove it in a future release of Biopython. As an alternative, please consider using Bio.Align.PairwiseAligner as a replacement, and contact the Biopython developers if you still need the Bio.pairwise2 module.
warnings.warn(
The code, data, and weights for this work are made available for non-commercial use
(including at commercial entities) under the terms of the JHU Academic Software License
Agreement. For commercial inquiries, please contact awichma2[at]jhu.edu.
License: https://github.com/Graylab/IgFold/blob/main/LICENSE.md
Loading 4 IgFold models...
/home/dell/.local/lib/python3.10/site-packages/torch/cuda/init.py:734: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
/home/dell/.local/lib/python3.10/site-packages/torch/cuda/init.py:936: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:109.)
r = torch._C._cuda_getDeviceCount() if nvml_count < 0 else nvml_count
Using device: cpu
Loading /home/dell/.local/lib/python3.10/site-packages/igfold/trained_models/IgFold/igfold_1.ckpt...
Traceback (most recent call last):
File "/home/dell/Documents/SARS_CoV/Igfold.py", line 12, in
igfold = IgFoldRunner()
File "/home/dell/.local/lib/python3.10/site-packages/igfold/IgFoldRunner.py", line 68, in init
IgFold.load_from_checkpoint(ckpt_file).eval().to(device))
File "/home/dell/.local/lib/python3.10/site-packages/pytorch_lightning/core/saving.py", line 137, in load_from_checkpoint
return _load_from_checkpoint(
File "/home/dell/.local/lib/python3.10/site-packages/pytorch_lightning/core/saving.py", line 158, in _load_from_checkpoint
checkpoint = pl_load(checkpoint_path, map_location=map_location)
File "/home/dell/.local/lib/python3.10/site-packages/lightning_lite/utilities/cloud_io.py", line 48, in _load
return torch.load(f, map_location=map_location)
File "/home/dell/.local/lib/python3.10/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.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 transformers.models.bert.configuration_bert.BertConfig was not an allowed global by default. Please use torch.serialization.add_safe_globals([BertConfig]) or the torch.serialization.safe_globals([BertConfig]) 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.
(igfold) dell:~/Documents/SARS_CoV$ python Igfold.py
/home/dell/.local/lib/python3.10/site-packages/Bio/pairwise2.py:278: BiopythonDeprecationWarning: Bio.pairwise2 has been deprecated, and we intend to remove it in a future release of Biopython. As an alternative, please consider using Bio.Align.PairwiseAligner as a replacement, and contact the Biopython developers if you still need the Bio.pairwise2 module.
warnings.warn(
Loading 4 IgFold models...
/home/dell/.local/lib/python3.10/site-packages/torch/cuda/init.py:734: UserWarning: Can't initialize NVML
warnings.warn("Can't initialize NVML")
/home/dell/.local/lib/python3.10/site-packages/torch/cuda/init.py:936: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:109.)
r = torch._C._cuda_getDeviceCount() if nvml_count < 0 else nvml_count
Using device: cpu
Loading /home/dell/.local/lib/python3.10/site-packages/igfold/trained_models/IgFold/igfold_1.ckpt...
Traceback (most recent call last):
File "/home/dell/Documents/SARS_CoV/Igfold.py", line 12, in
igfold = IgFoldRunner()
File "/home/dell/.local/lib/python3.10/site-packages/igfold/IgFoldRunner.py", line 68, in init
IgFold.load_from_checkpoint(ckpt_file).eval().to(device))
File "/home/dell/.local/lib/python3.10/site-packages/pytorch_lightning/core/saving.py", line 137, in load_from_checkpoint
return _load_from_checkpoint(
File "/home/dell/.local/lib/python3.10/site-packages/pytorch_lightning/core/saving.py", line 158, in _load_from_checkpoint
checkpoint = pl_load(checkpoint_path, map_location=map_location)
File "/home/dell/.local/lib/python3.10/site-packages/lightning_lite/utilities/cloud_io.py", line 48, in _load
return torch.load(f, map_location=map_location)
File "/home/dell/.local/lib/python3.10/site-packages/torch/serialization.py", line 1470, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.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_onlyargument intorch.loadfromFalsetoTrue. Re-runningtorch.loadwithweights_onlyset toFalsewill 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=Trueplease check the recommended steps in the following error message.WeightsUnpickler error: Unsupported global: GLOBAL transformers.models.bert.configuration_bert.BertConfig was not an allowed global by default. Please use
torch.serialization.add_safe_globals([BertConfig])or thetorch.serialization.safe_globals([BertConfig])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.