Installation
Get STGNN up and running in your environment by following these installation steps.System requirements
Before installing STGNN, ensure your system meets these requirements:- Python: 3.8 or higher
- CUDA: 11.0 or higher (for GPU acceleration)
- Memory: At least 16GB RAM recommended
- Storage: Sufficient space for fMRI data (varies by dataset size)
GPU acceleration is strongly recommended for training. CPU-only training is possible but will be significantly slower.
Dependencies
STGNN requires the following key packages:Core dependencies
- PyTorch (≥2.0.0): Deep learning framework
- PyTorch Geometric (≥2.3.0): Graph neural network library
- torch-scatter (≥2.1.0): Scatter operations for PyTorch Geometric
Data processing
- NumPy (≥1.21.0): Numerical computing
- pandas (≥1.5.0): Data manipulation
- SciPy (≥1.9.0): Scientific computing
Machine learning
- scikit-learn (≥1.2.0): ML utilities and metrics
- Optuna (≥3.4.0): Hyperparameter optimization
- optuna-dashboard (≥0.15.0): Optuna visualization dashboard
Visualization
- matplotlib (≥3.5.0): Plotting library
- plotly (≥5.17.0): Interactive visualizations
- kaleido (≥0.2.1): Static image export for plotly
Utilities
- tqdm (≥4.64.0): Progress bars
Installation steps
Create a virtual environment (optional but recommended)
Create an isolated Python environment for the project:
Install PyTorch with CUDA support
Install PyTorch with CUDA support for your system. Visit pytorch.org to get the appropriate command for your CUDA version.Example for CUDA 11.8:For CPU-only installation:
Install remaining dependencies
Install all other required packages from the requirements file:This installs all dependencies listed in the requirements.txt file:
requirements.txt
Troubleshooting
CUDA compatibility issues
If you encounter CUDA-related errors, ensure that:- Your NVIDIA driver is up to date
- The PyTorch CUDA version matches your installed CUDA toolkit
torch.cuda.is_available()returnsTrue
PyTorch Geometric installation issues
If PyTorch Geometric installation fails:- Ensure PyTorch is installed first
- Check that your PyTorch version is compatible with PyTorch Geometric
- Try installing from conda-forge:
Memory errors
If you encounter out-of-memory errors:- Reduce the batch size using
--batch_sizeparameter - Reduce GNN hidden dimensions using
--gnn_hidden_dim - Use a machine with more RAM or GPU memory