Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _variable_with_weight_decay(name, shape, wd):
Variable Tensor
"""
var = _variable_on_cpu(name, shape,
initializer=tf.contrib.layers.xavier_initializer())
initializer=tf.contrib.layers.xavier_initializer(uniform=False))
if wd:
weight_decay = tf.multiply(tf.nn.l2_loss(var), wd, name='weight_loss')
tf.add_to_collection('losses', weight_decay)
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test(dataset, ckptfile):
saver = tf.train.Saver(tf.all_variables(), max_to_keep=1000)

init_op = tf.global_variables_initializer()
sess = tf.Session(config=tf.ConfigProto(log_device_placement=FLAGS.log_device_placement))
sess = tf.Session(config=tf.ConfigProto(log_device_placement=FLAGS.log_device_placement, gpu_options=tf.GPUOptions(allow_growth=True)))

saver.restore(sess, ckptfile)
print 'restore variables done'
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def train(dataset_train, dataset_val, ckptfile='', caffemodel=''):
saver = tf.train.Saver(tf.all_variables(), max_to_keep=1000)

init_op = tf.global_variables_initializer()
sess = tf.Session(config=tf.ConfigProto(log_device_placement=FLAGS.log_device_placement))
sess = tf.Session(config=tf.ConfigProto(log_device_placement=FLAGS.log_device_placement, gpu_options=tf.GPUOptions(allow_growth=True)))

if is_finetune:
# load checkpoint file
Expand Down