# Coder: Wenxin Xu
# Github: https://github.com/wenxinxu/resnet_in_tensorflow
# ==============================================================================
import tensorflow as tf
import os
# FLAGS=tf.compat.v1.flags.Flag
FLAGS = tf.app.flags.FLAGS

ckpt_path = 'wz_trained_models/model.ckpt-30000'
ckpt_path = 'wz_train_dir/model.ckpt-0122'

is_use_ckpt = 1

# train_dir = 'logs_' + FLAGS.version + '/'
train_dir = 'wz_train_dir/'
# train_dir = 'D:\\wz4398\\Desktop\\resnet-wz\\'
train_steps = [int(8e4), 5000][0]








## The following flags are related to save paths, tensorboard outputs and screen outputs
# # .DEFINE_string
# if tf.__version__=='2.3.0':
#     flags=tf.compat.v1.flags
# else:
#     flags=tf.app.flags

tf.app.flags.DEFINE_string('version', 'test_110', '''A version number defining the directory to save
logs and checkpoints''')
tf.app.flags.DEFINE_integer('report_freq', 20, '''Steps takes to output errors on the screen
and write summaries''')
tf.app.flags.DEFINE_float('train_ema_decay', 0.95, '''The decay factor of the train error's
moving average shown on tensorboard''')


## The following flags define hyper-parameters regards training

tf.app.flags.DEFINE_integer('train_steps', train_steps, '''Total steps that you want to train''')
tf.app.flags.DEFINE_boolean('is_full_validation', False, '''Validation w/ full validation set or
a random batch''')
tf.app.flags.DEFINE_integer('train_batch_size', 128, '''Train batch size''')
tf.app.flags.DEFINE_integer('validation_batch_size', 250, '''Validation batch size, better to be
a divisor of 10000 for this task''')
tf.app.flags.DEFINE_integer('test_batch_size', 125, '''Test batch size''')

tf.app.flags.DEFINE_float('init_lr', 0.1, '''Initial learning rate''')
tf.app.flags.DEFINE_float('lr_decay_factor', 0.1, '''How much to decay the learning rate each
time''')
tf.app.flags.DEFINE_integer('decay_step0', 40000, '''At which step to decay the learning rate''')
tf.app.flags.DEFINE_integer('decay_step1', 60000, '''At which step to decay the learning rate''')


## The following flags define hyper-parameters modifying the training network

tf.app.flags.DEFINE_integer('num_residual_blocks', 5, '''How many residual blocks do you want''')
tf.app.flags.DEFINE_float('weight_decay', 0.0002, '''scale for l2 regularization''')


## The following flags are related to data-augmentation

tf.app.flags.DEFINE_integer('padding_size', 2, '''In data augmentation, layers of zero padding on
each side of the image''')


## If you want to load a checkpoint and continue training

tf.app.flags.DEFINE_string('ckpt_path', ckpt_path, '''Checkpoint
directory to restore''')
tf.app.flags.DEFINE_boolean('is_use_ckpt', is_use_ckpt, '''Whether to load a checkpoint and continue
training''')

tf.app.flags.DEFINE_string('test_ckpt_path', ckpt_path, '''Checkpoint
directory to restore''')


# flags.DEFINE_string('version', 'test_110', '''A version number defining the directory to save
# logs and checkpoints''')
# flags.DEFINE_integer('report_freq', 20, '''Steps takes to output errors on the screen
# and write summaries''')
# flags.DEFINE_float('train_ema_decay', 0.95, '''The decay factor of the train error's
# moving average shown on tensorboard''')


# ## The following flags define hyper-parameters regards training

# flags.DEFINE_integer('train_steps', train_steps, '''Total steps that you want to train''')
# flags.DEFINE_boolean('is_full_validation', False, '''Validation w/ full validation set or
# a random batch''')
# flags.DEFINE_integer('train_batch_size', 128, '''Train batch size''')
# flags.DEFINE_integer('validation_batch_size', 250, '''Validation batch size, better to be
# a divisor of 10000 for this task''')
# flags.DEFINE_integer('test_batch_size', 125, '''Test batch size''')

# flags.DEFINE_float('init_lr', 0.1, '''Initial learning rate''')
# flags.DEFINE_float('lr_decay_factor', 0.1, '''How much to decay the learning rate each
# time''')
# flags.DEFINE_integer('decay_step0', 40000, '''At which step to decay the learning rate''')
# flags.DEFINE_integer('decay_step1', 60000, '''At which step to decay the learning rate''')


# ## The following flags define hyper-parameters modifying the training network

# flags.DEFINE_integer('num_residual_blocks', 5, '''How many residual blocks do you want''')
# flags.DEFINE_float('weight_decay', 0.0002, '''scale for l2 regularization''')


# ## The following flags are related to data-augmentation

# flags.DEFINE_integer('padding_size', 2, '''In data augmentation, layers of zero padding on
# each side of the image''')


# ## If you want to load a checkpoint and continue training

# flags.DEFINE_string('ckpt_path', ckpt_path, '''Checkpoint
# directory to restore''')
# flags.DEFINE_boolean('is_use_ckpt', is_use_ckpt, '''Whether to load a checkpoint and continue
# training''')

# flags.DEFINE_string('test_ckpt_path', ckpt_path, '''Checkpoint
# directory to restore''')
