def build_model(self):
    (img_in, img_gt) = self.input_producer(self.batch_size)
    tf.summary.image('img_in', im2uint8(img_in))
    tf.summary.image('img_gt', im2uint8(img_gt))
    print('img_in, img_gt', img_in.get_shape(), img_gt.get_shape())
    x_unwrap = self.generator(img_in, reuse=False, scope='g_net')
    self.loss_total = 0
    for i in xrange(self.n_levels):
        (_, hi, wi, _) = x_unwrap[i].get_shape().as_list()
        gt_i = tf.image.resize_images(img_gt, [hi, wi], method=0)
        loss = tf.reduce_mean(((gt_i - x_unwrap[i]) ** 2))
        self.loss_total += loss
        tf.summary.image(('out_' + str(i)), im2uint8(x_unwrap[i]))
        tf.summary.scalar(('loss_' + str(i)), loss)
    tf.summary.scalar('loss_total', self.loss_total)
    all_vars = tf.trainable_variables()
    self.all_vars = all_vars
    self.g_vars = [var for var in all_vars if ('g_net' in var.name)]
    self.lstm_vars = [var for var in all_vars if ('LSTM' in var.name)]
    for var in all_vars:
        print(var.name)
def build_model(self):
    (img_in, img_gt) = self.input_producer(self.batch_size)
    tf.summary.image('img_in', im2uint8(img_in))
    tf.summary.image('img_gt', im2uint8(img_gt))
    print('img_in, img_gt', img_in.get_shape(), img_gt.get_shape())
    x_unwrap = self.generator(img_in, reuse=False, scope='g_net')
    self.loss_total = 0
    for i in xrange(self.n_levels):
        (_, hi, wi, _) = x_unwrap[i].get_shape().as_list()
        gt_i = tf.image.resize_images(img_gt, [hi, wi], method=0)
        loss = tf.reduce_mean(((gt_i - x_unwrap[i]) ** 2))
        self.loss_total += loss
        tf.summary.image(('out_' + str(i)), im2uint8(x_unwrap[i]))
        tf.summary.scalar(('loss_' + str(i)), loss)
    tf.summary.scalar('loss_total', self.loss_total)
    all_vars = tf.trainable_variables()
    self.all_vars = all_vars
    self.g_vars = [var for var in all_vars if ('g_net' in var.name)]
    self.lstm_vars = [var for var in all_vars if ('LSTM' in var.name)]
    for var in all_vars:
        print(var.name)