DeOldify / docs /nvidia_setup.md
thookham's picture
Initial commit for Hugging Face sync (Clean History)
e9f9fd3
|
raw
history blame
2.08 kB

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

  1. Clone the Repository

    git clone https://github.com/thookham/DeOldify.git
    cd DeOldify
    
  2. Create Conda Environment We use a modern environment file that installs PyTorch 2.5+ and CUDA 12.4 support.

    conda env create -f environment.yml
    
  3. Activate Environment

    conda activate deoldify
    
  4. Download 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-smi to check driver status.
  • Ensure you installed the environment from environment.yml which pulls pytorch-cuda.

"Out of Memory"

  • Reduce render_factor in 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