Skip to content

Commit

Permalink
changed order of load / train modes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaminriedel committed Jun 8, 2017
1 parent 0b32d21 commit 3f9e2fd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pred.py
Expand Up @@ -19,7 +19,7 @@
import tensorflow as tf


# Set mode
# Prompt for mode
mode = input('mode (load / train)? ')


Expand Down Expand Up @@ -84,6 +84,17 @@
predict = tf.arg_max(softmaxed_logits, 1)


# Load model
if mode == 'load':
with tf.Session() as sess:
load_model(sess)


# Predict
test_feed_dict = {features_pl: test_set, keep_prob_pl: 1.0}
test_pred = sess.run(predict, feed_dict=test_feed_dict)


# Train model
if mode == 'train':

Expand Down Expand Up @@ -116,16 +127,5 @@
test_pred = sess.run(predict, feed_dict=test_feed_dict)


# Load model
if mode == 'load':
with tf.Session() as sess:
load_model(sess)


# Predict
test_feed_dict = {features_pl: test_set, keep_prob_pl: 1.0}
test_pred = sess.run(predict, feed_dict=test_feed_dict)


# Save predictions
save_predictions(test_pred, file_predictions)

0 comments on commit 3f9e2fd

Please sign in to comment.