Closed pikawika closed 3 years ago
git clone https://github.com/harskish/ganspace/
conda create -n ganspace python=3.7
conda activate ganspace
cd ganspace/
conda env update -f environment.yml --prune
git submodule update --init --recursive
python -c "import nltk; nltk.download('wordnet')"
The interactive viewer (interactive.py) has the following dependencies:
EXTRA: Activate environment: conda activate ganspace
sudo apt install ctags
export CUDA_HOME=/usr/local/cuda-10.1
tar -xzf pycuda-VERSION.tar.gz
cd pycuda-VERSION/
python configure.py --cuda-enable-gl --cuda-root=/path/to/cuda
python configure.py --cuda-root=$CUDA_HOME --cuda-enable-gl
make install
sudo apt -y install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
pip install pytest
cd test/
python test_driver.py
pip install setuptools cython glumpy
pip install Cython
pip install colormap
pip install easydev
pip install pillow
pip uninstall glumpy
pip install glumpy
StyleGAN2 contains custom CUDA kernels for improved performance. Less performant native PyTorch fallbacks are used by default.
EXTRA: go to root of ganspace
sudo cp /usr/local/cuda-10.2/targets/x86_64-linux/include/cublas_v2.h /usr/local/cuda-10.1/targets/x86_64-linux/include/cublas_v2.h
sudo cp /usr/local/cuda-10.2/targets/x86_64-linux/include/cublas_api.h /usr/local/cuda-10.1/targets/x86_64-linux/include/cublas_api.h
cd models/stylegan2/stylegan2-pytorch/op
python setup.py install
python -c "import torch; import upfirdn2d_op; import fused; print('OK')"
I've posted a somewhat updated setup.md for people having the same issues as me, such as:
Setup (with extra's for Ubuntu 20.04)
git clone https://github.com/harskish/ganspace/
conda create -n ganspace python=3.7
conda activate ganspace
cd ganspace/
conda env update -f environment.yml --prune
git submodule update --init --recursive
python -c "import nltk; nltk.download('wordnet')"
Interactive viewer
The interactive viewer (interactive.py) has the following dependencies:
Linux (ubuntu 20.04)
EXTRA: Activate environment:
conda activate ganspace
sudo apt install ctags
export CUDA_HOME=/usr/local/cuda-10.1
tar -xzf pycuda-VERSION.tar.gz
cd pycuda-VERSION/
python configure.py --cuda-enable-gl --cuda-root=/path/to/cuda
python configure.py --cuda-root=$CUDA_HOME --cuda-enable-gl
make install
sudo apt -y install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
pip install pytest
cd test/
python test_driver.py
pip install setuptools cython glumpy
pip install Cython
EXTRA: non installed pip dependencies
pip install colormap
pip install easydev
pip install pillow
pip uninstall glumpy
pip install glumpy
StyleGAN2 setup (optional)
StyleGAN2 contains custom CUDA kernels for improved performance.
Less performant native PyTorch fallbacks are used by default.
EXTRA: go to root of ganspace
conda activate ganspace
export CUDA_HOME=/usr/local/cuda-10.1
sudo cp /usr/local/cuda-10.2/targets/x86_64-linux/include/cublas_v2.h /usr/local/cuda-10.1/targets/x86_64-linux/include/cublas_v2.h
sudo cp /usr/local/cuda-10.2/targets/x86_64-linux/include/cublas_api.h /usr/local/cuda-10.1/targets/x86_64-linux/include/cublas_api.h
cd models/stylegan2/stylegan2-pytorch/op
python setup.py install
python -c "import torch; import upfirdn2d_op; import fused; print('OK')"