Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6c4bd1a

Browse files
Update training_and_val.py
1 parent 123d317 commit 6c4bd1a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎04 VGG Tensorflow/training_and_val.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,16 @@ def train():
5555
is_train=False,
5656
batch_size= BATCH_SIZE,
5757
shuffle=False)
58+
59+
x = tf.placeholder(tf.float32, shape=[BATCH_SIZE, IMG_W, IMG_H, 3])
60+
y_ = tf.placeholder(tf.int16, shape=[BATCH_SIZE, N_CLASSES])
5861

59-
logits = VGG.VGG16N(tra_image_batch, N_CLASSES, IS_PRETRAIN)
60-
loss = tools.loss(logits, tra_label_batch)
61-
accuracy = tools.accuracy(logits, tra_label_batch)
62-
my_global_step = tf.Variable(0, name='global_step', trainable=False)
63-
train_op = tools.optimize(loss, learning_rate, my_global_step)
62+
logits = VGG.VGG16N(x, N_CLASSES, IS_PRETRAIN)
63+
loss = tools.loss(logits, y_)
64+
accuracy = tools.accuracy(logits, y_)
6465

65-
x = tf.placeholder(tf.float32, shape=[BATCH_SIZE, IMG_W, IMG_H, 3])
66-
y_ = tf.placeholder(tf.int16, shape=[BATCH_SIZE, N_CLASSES])
66+
my_global_step = tf.Variable(0, name='global_step', trainable=False)
67+
train_op = tools.optimize(loss, learning_rate, my_global_step)
6768

6869
saver = tf.train.Saver(tf.global_variables())
6970
summary_op = tf.summary.merge_all()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /