Skip to content
DCGAN LSGAN WGAN-GP DRAGAN Tensorflow 2
Python Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
imlib Tensorflow 2.0 Alpha Apr 7, 2019
pics Tensorflow 2.0 Alpha Apr 7, 2019
pylib Tensorflow 2.0 Alpha Apr 7, 2019
tf2gan Tensorflow 2.0 Alpha Apr 7, 2019
tf2lib Tensorflow 2.0 Alpha Apr 7, 2019
v1 Tensorflow 2.0 Alpha Apr 7, 2019
.gitignore Tensorflow 2.0 Alpha Apr 7, 2019
LICENSE ... Oct 20, 2017
README.md README.md: add PyTorch link Jun 27, 2019
commands.sh Tensorflow 2.0 Alpha Apr 7, 2019
data.py Tensorflow 2.0 Alpha Apr 7, 2019
make_gif.py Tensorflow 2.0 Alpha Apr 7, 2019
module.py module.py: update Jun 26, 2019
train.py train.py: update Jun 27, 2019

README.md

Recommendation

  • Our GAN based work for facial attribute editing - AttGAN.

New

  • 8 April 2019: We re-implement these GANs by Tensorflow 2! The old version is here: v1 or in the "v1" directory.
  • PyTorch Version


GANs - Tensorflow 2

Tensorflow 2 implementations of DCGAN, LSGAN, WGAN-GP and DRAGAN.

Exemplar results

Fashion-MNIST

DCGAN LSGAN WGAN-GP DRAGAN

CelebA

DCGAN LSGAN
WGAN-GP DRAGAN

Anime

WGAN-GP DRAGAN

Usage

  • Prerequisites

    • Tensorflow 2.0 Alpha pip install tensorflow-gpu==2.0.0-alpha0
    • Tensorflow Addons pip install tensorflow-addons
    • (if you meet "tf.summary.histogram fails with TypeError" pip install --upgrade tb-nightly)
    • scikit-image, oyaml, tqdm
    • Python 3.6
  • Datasets

  • Examples of training

    • Fashion-MNIST DCGAN

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=fashion_mnist --epoch=25 --adversarial_loss_mode=gan
    • CelebA DRAGAN

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=celeba --epoch=25 --adversarial_loss_mode=gan --gradient_penalty_mode=dragan
    • Anime WGAN-GP

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=anime --epoch=200 --adversarial_loss_mode=wgan --gradient_penalty_mode=wgan-gp --n_d=5
    • see more training exampls in commands.sh

    • tensorboard for loss visualization

      tensorboard --logdir ./output/fashion_mnist_gan/summaries --port 6006
You can’t perform that action at this time.