SchNet: Deep Learning for Molecules and Materials

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.

Background

🛠 Manual Installation Guide for SchNetPack

1. Create Conda Environment

conda create -n schnetpack1 python=3.12 -y
conda activate schnetpack1

2. Install PyTorch (CUDA 11.8)

pip install torch==2.5.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Check GPU access:

python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"

3. Clone and Prepare SchNetPack

git clone https://github.com/atomistic-machine-learning/schnetpack.git
cd schnetpack

4. Edit pyproject.toml to avoid preinstalled library conflicts

# "torch>=2.5.0",
# "torchmetrics",
"numpy>=2.0.0",

5. Install the Package

pip install -e .[cli]

6. Fix CLI Script on Windows

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()

7. Run a Test Training

cd src/scripts
set PWD=%CD%
python spktrain.py experiment=qm9_atomwise run.id=gpu_test +training.max_epochs=1

8. Verify GPU Usage

GPU available: True (cuda), used: True

✅ SchNetPack Running Successfully

Below is a screenshot showing a successful training loop running on GPU:

SchNetPack Training Screenshot