Create environment and set dependencies:
conda create -n constrained_gan python=3.8
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create false
conda activate constrained_gan
conda install tensorflow-gpu==2.4.1
poetry install
Check whether TF can see GPU:
import tensorflow.compat.v1 as tf
tf.test.gpu_device_name()
If FID computation stucks that might be caused by conflict with scipy. Try running export MKL_NUM_THREADS=1
.
./scripts/install_studiogan.sh
To use StudioGAN as is following is needed:
import sys
from pathlib import Path
from maxent_gan.utils.general_utils import ROOT_DIR
sys.path.append(Path(ROOT_DIR, 'studiogan'))
poetry install
Put CIFAR-10 into directory data/cifar10
using this script
import torchvision.datasets as dset
cifar = dset.CIFAR10(root='data/cifar10', download=True)
Make bash scripts runable
chmod +x -R scripts/*.sh
Download checkpoints:
dvc pull
To use wandb:
wandb login
python run.py configs/exp_configs/dcgan-inception.yml configs/targets/discriminator.yml \
configs/gan_configs/cifar-10-dcgan.yml configs/feature_configs/inception.yml \
configs/mcmc_configs/{ula/mala/isir/ex2mcmc/flex2mcmc}.yml configs/mcmc_exp.yml