From 07e2f9251b02b463515a96aeba019b034dccc95a Mon Sep 17 00:00:00 2001 From: Armour <497052684@qq.com> Date: Tue, 13 Dec 2016 10:15:09 -0800 Subject: [PATCH] added tensorflow graph to README.md --- README.md | 4 ++++ common.py | 6 +++--- config.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6fb622b..4d1590d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ Used pre-trained VGG16 model from [https://github.com/machrisaa/tensorflow-vgg]( * `train.py`: train the residual encoder model using tensorflow build-in GradientDescentOptimizer * `test.py`: test your own image and save the output image +## Tensorflow graph + +![](images/residuall_encoder.png) + ## How to use * First please download pre-trained VGG16 model [vgg16.npy](https://mega.nz/#!YU1FWJrA!O1ywiCS2IiOlUCtCpI6HTJOMrneN-Qdv3ywQP5poecM) to vgg folder diff --git a/common.py b/common.py index bea868a..35a7b16 100644 --- a/common.py +++ b/common.py @@ -55,7 +55,7 @@ def init_model(train=True): residual_encoder = ResidualEncoder() # Color image - color_image_rgb = input_pipeline(file_paths, batch_size) + color_image_rgb = input_pipeline(file_paths, batch_size, test=not train) color_image_yuv = rgb_to_yuv(color_image_rgb, "rgb2yuv_for_color_image") # Gray image @@ -85,10 +85,10 @@ def init_model(train=True): exclusive=True, name="cost") # Using different learning rate in different training steps - lr = tf.div(learning_rate, tf.cast(tf.pow(2, tf.div(global_step, 160000)), tf.float32), name="learning_rate") + # lr = tf.div(learning_rate, tf.cast(tf.pow(2, tf.div(global_step, 160000)), tf.float32), name="learning_rate") # Optimizer - optimizer = tf.train.GradientDescentOptimizer(learning_rate=lr).minimize(cost, global_step=global_step) + optimizer = tf.train.GradientDescentOptimizer(learning_rate=learning_rate).minimize(cost, global_step=global_step) # Summaries print "Init summaries" diff --git a/config.py b/config.py index 2eae1e9..07dbffc 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,7 @@ image_size = 224 # Parameters for neural network -learning_rate = 1e-4 # Initial learning rate, every 5000 step we divide this by 2 +learning_rate = 1e-4 # Learning rate training_iters = 2400000 # The training iterations number batch_size = 1 # The batch size display_step = 1 # Display loss for each step