NVIDIA GPU Setup Guide for DeOldify
This guide covers how to set up DeOldify with modern NVIDIA GPUs (RTX 30xx, 40xx, 50xx) using CUDA 12.x and PyTorch 2.5+.
Prerequisites
- NVIDIA Driver: Version 550.x or later (supports CUDA 12.4+)
- Anaconda or Miniconda installed
- Git installed
Installation Steps
Clone the Repository
git clone https://github.com/thookham/DeOldify.git cd DeOldifyCreate Conda Environment We use a modern environment file that installs PyTorch 2.5+ and CUDA 12.4 support.
conda env create -f environment.ymlActivate Environment
conda activate deoldifyDownload Weights Download the pretrained weights and place them in the
models/directory:mkdir -p models # Example using wget wget https://github.com/thookham/DeOldify/releases/download/v2.0-models/ColorizeArtistic_gen.pth -O models/ColorizeArtistic_gen.pth
Verification
Run the verification script to ensure everything is set up correctly:
python verify_refactor.py
Troubleshooting
"CUDA not available"
- Ensure you have the correct NVIDIA drivers installed.
- Run
nvidia-smito check driver status. - Ensure you installed the environment from
environment.ymlwhich pullspytorch-cuda.
"Out of Memory"
- Reduce
render_factorin your scripts. - Ensure no other processes are using the GPU.
Performance Tuning
- For RTX 40xx/50xx series, you can enable TF32 for better performance:
import torch torch.backends.cuda.matmul.allow_tf32 = True torch.backends.cudnn.allow_tf32 = True