seungwookim / vae.tensorflow.slim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variational Auto-Encoder with TensorFlow & slim

Requirements

  • TensorFlow 1.1.0 or greater (?)
  • opencv (for generate.py)
  • numpy

Training

editing train.sh

  • Set the "TRAIN_DIR" (where to save checkpoint) to path you want
  • Set the hyper-parameters

train.sh

# Working directory
WORKING_DIR=$HOME/projects

# Where the training (fine-tuned) checkpoint and logs will be saved to.
TRAIN_DIR=$WORKING_DIR/vae.tensorflow.slim/exp1

CUDA_VISIBLE_DEVICES=0 \
python train.py \
    --train_dir=${TRAIN_DIR} \
    --batch_size=64 \
    --max_steps=100000 \
    --save_steps=5000 \

run ./train.sh

$ ./train.sh
  • You can use tensorboard for monitoring loss and generated images
$ tensorboard --logdir=exp1

Generate images

generate.sh

# Working directory
WORKING_DIR=$HOME/projects

# Where the training (fine-tuned) checkpoint and logs will be saved to.
TRAIN_DIR=$WORKING_DIR/vae.tensorflow.slim/exp1

batch=$1

CUDA_VISIBLE_DEVICES=0 \
python image_translate.py \
    --checkpoint_path=${TRAIN_DIR} \
    --checkpoint_step=-1 \
    --batch_size=$batch \
    --seed=12345 \
    --save_step=1000 \

convert -delay 30 -loop 0 *.jpg generated_images.gif

run ./generate.sh

$ ./generate.sh batch_size (the number of images you want)

Results

MNIST datasets

Epoch 1

assets

Epoch 100

assets

Gif

assets

References

Papers

Blogs

My presentation file (DeepLAB in ModuLabs)

Author

Il Gu Yi

About


Languages

Language:Python 95.3%Language:Shell 4.7%