- Install anaconda or miniconda
- Create environment:
conda create -n ganspace python=3.7
- Activate environment:
conda activate ganspace
- Install dependencies:
conda env update -f environment.yml --prune
- Setup submodules:
git submodule update --init --recursive
- Run command
python -c "import nltk; nltk.download('wordnet')"
The interactive viewer (interactive.py) has the following dependencies:
- Glumpy
- PyCUDA with OpenGL support
Install included dependencies (downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/):
pip install deps/windows/*
- Install CUDA toolkit (match the version in environment.yml)
- Download pycuda sources from: https://pypi.org/project/pycuda/#files
- Extract files:
tar -xzf pycuda-VERSION.tar.gz
- Configure:
python configure.py --cuda-enable-gl --cuda-root=/path/to/cuda
- Compile and install:
make install
- Install Glumpy:
pip install setuptools cython glumpy
The bundled StyleGAN2 model requires additional setup steps due to the custom CUDA kernels involved.
- Install CUDA toolkit (match the version in environment.yml)
- On Windows: install and open 'x64 Native Tools Command Prompt for VS 2017'
conda activate ganspace
cd models/stylegan2/stylegan2-pytorch/op
python setup.py install
- Test:
python -c "import torch; import upfirdn2d_op; import fused; print('OK')"