SchNet is a deep neural network designed to model quantum interactions in molecular and material systems. It uses continuous-filter convolutional layers and message passing mechanisms to predict properties like energy, forces, dipole moments, and more directly from atomic coordinates.
conda create -n schnetpack1 python=3.12 -y
conda activate schnetpack1
pip install torch==2.5.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"
git clone https://github.com/atomistic-machine-learning/schnetpack.git
cd schnetpack
pyproject.toml
to avoid preinstalled library conflicts# "torch>=2.5.0",
# "torchmetrics",
"numpy>=2.0.0",
pip install -e .[cli]
mv src/scripts/spktrain src/scripts/spktrain.py
Update its contents:
#!/usr/bin/env python3
import schnetpack.cli as cli
if __name__ == "__main__":
cli.train()
cd src/scripts
set PWD=%CD%
python spktrain.py experiment=qm9_atomwise run.id=gpu_test +training.max_epochs=1
GPU available: True (cuda), used: True
Below is a screenshot showing a successful training loop running on GPU: