Skip to content

Commit

Permalink
Append model shape to the checkpoint directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
igv committed Aug 21, 2017
1 parent 15bc798 commit f8af70e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def prelu(self, _x, i):

def save(self, checkpoint_dir, step):
model_name = "FSRCNN.model"
model_dir = "%s_%s" % ("fsrcnn", self.label_size)
d, s, m = self.model_params
model_dir = "%s_%s_%s-%s-%s" % ("fsrcnn", self.label_size, d, s, m)
checkpoint_dir = os.path.join(checkpoint_dir, model_dir)

if not os.path.exists(checkpoint_dir):
Expand All @@ -238,7 +239,8 @@ def save(self, checkpoint_dir, step):

def load(self, checkpoint_dir):
print(" [*] Reading checkpoints...")
model_dir = "%s_%s" % ("fsrcnn", self.label_size)
d, s, m = self.model_params
model_dir = "%s_%s_%s-%s-%s" % ("fsrcnn", self.label_size, d, s, m)
checkpoint_dir = os.path.join(checkpoint_dir, model_dir)

ckpt = tf.train.get_checkpoint_state(checkpoint_dir)
Expand Down

0 comments on commit f8af70e

Please sign in to comment.