Skip to content

nmhkahn/DCGAN-tensorflow-slim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCGAN in tensorflow-slim

Implementation of DCGAN with TensorFlow slim. Base codes and models are from DCGAN in Tensorflow made by Taehoon Kim. At this time, this code only support Flower dataset, but maybe with some tweaks you can train/evaluate in other dataset.

I know there are lots of code of DCGAN, especially made by Taehoon Kim. However, this code implement DCGAN with the bleeding edges features of TensorFlow such as TF-Slim, tf.train.Supervisor and TFRecords etc.

Requirements

  • TensorFlow 1.0
  • SciPy
  • NumPy
  • wget (Python library)
  • Only tested in Python 3.4

Basic usages

Before train model, we have to convert dataset into TFRecords file format. To do that, first download Flower dataset and then convert (also you can use other dataset such as MNIST or CIFAR-10).

$ cd dataset
# for flower dataset
$ python download_and_convert.py flowers
# for celebA dataset
$ python download_and_convert.py celebA
# if you want to use other dataset, you might change provided code.

Above instructions will make flowers.tfrecords or celeba.tfrecords file in dataset directory.

To train model,

$ python3 dcgan/train.py

See dcgan/train.py and dcgan/config.py to modify arguments like logdir or batch_size etc (Someday I will provide argument parse codes).

Test (or sample) with trained model using below code.

$ python3 dcgan/sample.py

Note that checkpoint files must be located in logdir directory. See dcgan/train.py and dcgan/config.py. By default, logdir is set to log/ directory.

Results

Below examples are randomly selected from model with trained around 60k steps.

flower_result1 flower_result2

Some flowers looks fine, but most of images are bad. I believe that this is because Flower dataset has lots of noises, however on the other side, DCGAN's capacity doesn't enough to handle noisy images.

Plot in TensorBoard

Oops.. I accidentally deleted TensorBoard log file. :(

TODO

  1. Provide pre-trained model
  2. Apply argparse in train.py and sample.py
  3. TODOs

About

Implementation of DCGAN in TensorFlow-Slim

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages