TensorFlow 2 implementation of CycleGAN, also incorporated with WGAN-GP formulation and mixed-precision training.
This repository provide a concise example on how to use tf.distribute.MirroredStrategy
with custom training loops in TensorFlow 2. We adapt the CycleGAN (Zhu et. al. 2017) tutorials from Keras and TensorFlow and train the model with multiple GPUs. See towardsdatascience.com/multi-gpus-and-custom-training-loops-in-tensorflow-2-15b4b86b53bd for a detailed tutorial.
horse → zebra → horse | zebra → horse → zebra |
---|---|
![]() |
![]() |
conda create -n cyclegan python=3.8
conda activate cyclegan
sh setup.sh
horse2zebra
dataset from TensorFlow Datasets by default.--output_dir
runs/
:
CUDA_VISIBLE_DEVICES=0,1 python main.py --output_dir runs/ --epochs 200
--help
to see all available flags.TensorBoard
to inspect the training summary and plots
tensorboard --logdir runs/cyclegan