This is my own re-implemented version of Prefix Mol
- Original Code: https://github.com/A4Bio/PrefixMol
- Paper: https://arxiv.org/abs/2302.07120
# Major package
conda create -n prefixmol transformers deepchem=2.7.1 pytorch3d=0.7.2 jupyter openbabel -c pytorch3d
conda install rdkit=2022.3.1 -c rdkit
# install other missing packages vai conda
pip install nni partialsmiles # if you do this, you cannot use conda-pack to pack this environmentI have prepared a conda-packed environment, while installing the nni and partialsmiles packages in the PrefixMol
mkdir ~/software/miniconda3/envs/prefixmol # use your own env
tar -xzvf prefixmol.tar.gz -C ~/software/miniconda3/envs/prefixmol
conda activate prefixmol๐ Tips for pytorch3d installation
Notice that we recommend using the following steps to install pytorch3d ๐- install the following necessary packages.
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
- Find the suitable version with your environment
- Git clone the resporitory and then run the command as follows for example.
cd pytorch3d
python setup.py installPlease refer to README.md in the data folder.
We used DDP to accelerate the training process. Here are some command examples FYR.
# 4 GPUs
CUDA_VISIBLE_DEVICES="0,1,2,3" python -m torch.distributed.launch --nproc_per_node 4 train.py
# 8 GPUs
CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7" python -m torch.distributed.launch --nproc_per_node 8 train.py
When it comes to testing process, we loaded the checkpoint.pth and used 1 GPU to test the result.
CUDA_VISIBLE_DEVICES="0" python -m torch.distributed.launch --nproc_per_node 1 test.py
When running the codes, the path where the code appears is recommended to be changed to the path you need at the moment.
@article{gao2023prefixmol,
title={PrefixMol: Target-and Chemistry-aware Molecule Design via Prefix Embedding},
author={Gao, Zhangyang and Hu, Yuqi and Tan, Cheng and Li, Stan Z},
journal={arXiv preprint arXiv:2302.07120},
year={2023}
}
Zhangyang Gao ([email protected]) Yuqi Hu ([email protected])
