Skip to content

Commit b37db1a

Browse files
committed
fix some utils bugs v2
1 parent 38500d1 commit b37db1a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

configs/example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"num_iter_per_epoch": 10,
55
"learning_rate": 0.001,
66
"batch_size": 16,
7-
"state_size": [784]
7+
"state_size": [784],
8+
"max_to_keep":5
89
}

mains/example.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def main():
2626
sess = tf.Session()
2727
# create instance of the model you want
2828
model = ExampleModel(config)
29+
#load model if exist
30+
model.load(sess)
2931
# create your data generator
3032
data = DataGenerator(config)
3133
# create tensorboard logger

trainers/example_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def train_epoch(self):
2222
summaries_dict['loss'] = loss
2323
summaries_dict['acc'] = acc
2424
self.logger.summarize(cur_it, summaries_dict=summaries_dict)
25-
25+
self.model.save(self.sess)
2626
def train_step(self):
2727
batch_x, batch_y = next(self.data.next_batch(self.config.batch_size))
2828
feed_dict = {self.model.x: batch_x, self.model.y: batch_y, self.model.is_training: True}

0 commit comments

Comments
 (0)