Boltz-1安装使用指南
安装
-
首先先看官方GitHub:https://github.com/jwohlwend/boltz
-
最好新建环境安装:
conda create --name boltz1 python=3.9
-
默认安装流程是
pip install boltz -U
,但是国内安装速度巨慢,所以这边加一个镜像参数pip install boltz -U -i https://pypi.tuna.tsinghua.edu.cn/simple
-
安装成功以后使用命令
boltz
查看有无问题-
我这里有报错
-
(boltz1) ┌─[chunhui@Degron-ChunhuiXu] - [~] - [2024-12-20 04:41:58] └─[0] <> boltz Traceback (most recent call last): File "/home/chunhui/miniconda3/envs/boltz1/bin/boltz", line 5, in <module> from boltz.main import cli File "/home/chunhui/boltz/src/boltz/main.py", line 8, in <module> import torch File "/home/chunhui/miniconda3/envs/boltz1/lib/python3.9/site-packages/torch/__init__.py", line 367, in <module> from torch._C import * # noqa: F403 ImportError: /home/chunhui/miniconda3/envs/boltz1/lib/python3.9/site-packages/torch/lib/../../nvidia/cusparse/lib/libcusparse.so.12: undefined symbol: __nvJitLinkComplete_12_4, version libnvJitLink.so.12
-
(boltz1) ┌─[chunhui@Degron-ChunhuiXu] - [~] - [2024-12-23 11:18:23] └─[0] <> python -c "import torch; print(torch.__version__); print(torch.__path__)" Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/chunhui/miniconda3/envs/boltz1/lib/python3.9/site-packages/torch/__init__.py", line 367, in <module> from torch._C import * # noqa: F403 ImportError: /home/chunhui/miniconda3/envs/boltz1/lib/python3.9/site-packages/torch/lib/../../nvidia/cusparse/lib/libcusparse.so.12: undefined symbol: __nvJitLinkComplete_12_4, version libnvJitLink.so.12
- Torch包无法被正常加载,通过
pip install torch torchvision torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple
解决
-
-
此时继续测试
boltz
命令-
(boltz1) ┌─[chunhui@Degron-ChunhuiXu] - [~/boltz] - [2024-12-23 01:51:54] └─[130] <git:(main 327a0a6) > boltz Usage: boltz [OPTIONS] COMMAND [ARGS]... Boltz1. Options: --help Show this message and exit. Commands: predict Run predictions with Boltz-1.
-
加载CCD文件和训练权重文件
查阅GitHub repo可知,CCD文件和ckpt文件都需要从huggingface下载。
国内目前ban掉了huggingface
从VPS上下载好后转移到环境里使用
wget https://huggingface.co/boltz-community/boltz-1/resolve/main/ccd.pkl
wget https://huggingface.co/boltz-community/boltz-1/resolve/main/boltz1_conf.ckpt
测试示例文件
使用boltz predict examples/ligand.yaml --use_msa_server
来测试使用
(boltz1) ┌─[chunhui@Degron-ChunhuiXu] - [~/boltz] - [2024-12-23 02:04:30] └─[130] <git:(main 327a0a6) > boltz predict examples/ligand.yaml –use_msa_server Checking input data. Running predictions for 1 structure Processing input data. 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 8.65it/s] GPU available: True (cuda), used: True TPU available: False, using: 0 TPU cores HPU available: False, using: 0 HPUs /home/chunhui/miniconda3/envs/boltz1/lib/python3.9/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py:75: Starting from v1.9.0,
tensorboardX
has been removed as a dependency of thepytorch_lightning
package, due to potential conflicts with other packages in the ML ecosystem. For this reason,logger=True
will useCSVLogger
as the default logger, unless thetensorboard
ortensorboardX
packages are found. Pleasepip install lightning[extra]
or one of them to enable TensorBoard support by default You are using a CUDA device (‘NVIDIA RTX A4000’) that has Tensor Cores. To properly utilize them, you should settorch.set_float32_matmul_precision('medium' | 'high')
which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0] Predicting DataLoader 0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [06:18<00:00, 0.00it/s]Number of failed examples: 0 Predicting DataLoader 0: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [06:18<00:00, 0.00it/s]