Files
admet-ai/README.md
2025-08-27 22:41:35 +08:00

28 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 使用admet-ai预测
```bash
git clone https://github.com/swansonk14/admet_ai
cd admet_ai
micromamba create -n admet_ai python=3.10
micromamba activate admet_ai
pip install -r requirements.txt
pip install -e .
admet_predict --data_path ./data/molecules.csv --save_path ./data/preds.csv --smiles_column smiles
$env:OMP_NUM_THREADS="12"
$env:MKL_NUM_THREADS="12"
$env:NUMEXPR_NUM_THREADS="12"
$env:PYTORCH_NUM_THREADS="12"
admet_predict --data_path ./data/molecules.csv --save_path ./data/preds.csv --smiles_column smiles --num_workers 0 --no_cache_molecules
```
## pytorch 降级
看起来你遇到的是 PyTorch 2.6+ 把 torch.load 的默认参数改成了 weights_only=True 导致的非兼容问题。admet-ai通过 chemprop 的 load_args在加载 checkpoint 里保存的 argparse.Namespace 时没有显式设 weights_only=False因此触发了 PyTorch 的安全反序列化报错。详见官方说明2.6 起默认改动与报错指引。
```bash
micromamba activate admet_ai
python -c "import torch,sys;print(torch.__version__)"
pip install --upgrade 'torch<2.6'
pip install --upgrade 'torch<2.6' --index-url https://download.pytorch.org/whl/cu121
```