I'm having an error in the last line of the following code portion:
confusionMatrix = tf.confusion_matrix(labels=y_true_cls,predictions=y_pred_cls)
x_batch, y_batch, _, cls_batch = data.valid.next_batch(batch_size_validation)
confusionMatrix = session.run(confusionMatrix, feed_dict={x: x_batch, y_true: y_batch})
The error states the following:
NameError: name 'session' is not defined
At the end of my code (after the above code portion), I have the following:
with tf.Session() as session:
init = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer())
session.run(init)
train( num_iteration=1000)
How can I solve this issue?
Thanks.
sessioncan only be used within thewithblock...