Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

Commit

Permalink
(trivial) skip loading model if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
starcolon committed Apr 24, 2017
1 parent 45525ab commit a6b502d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def train(samples):
# NOTE: Automatically continue training the existing model
# Otherwise, starts a new model if there is no model file found.
cnn = train_model(
# TAOTODO: Should load the correct model
path_model if os.path.isfile(path_model) else None,
trainsetX,
trainsetY,
Expand Down
4 changes: 2 additions & 2 deletions model/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
def train_model(path, X, y, X_, y_, image_dim, final_vec_dim, epoch, batch_size):

# Create a new CNN
if path is None:
print(colored('Creating a new CNN.','green'))
if path is None or not os.path.isfile(path + '0'):
print(colored('Creating a new CNN.','cyan'))
cnn = CNN(image_dim, final_vec_dim)
else:
print(colored('Loading model from : {0}'.format(path),'green'))
Expand Down

0 comments on commit a6b502d

Please sign in to comment.