Skip to content

Commit a4418e8

Browse files
Merge pull request aymericdamien#64 from cnwarden/python_print_compatibility
fixed python2/3 print issue
2 parents 99e423d + b400c2c commit a4418e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/2_BasicModels/logistic_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@
5858
avg_cost += c / total_batch
5959
# Display logs per epoch step
6060
if (epoch+1) % display_step == 0:
61-
print "Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(avg_cost)
61+
print("Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(avg_cost))
6262

63-
print "Optimization Finished!"
63+
print("Optimization Finished!")
6464

6565
# Test model
6666
correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(y, 1))
6767
# Calculate accuracy
6868
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
69-
print "Accuracy:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels})
69+
print("Accuracy:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels}))

0 commit comments

Comments
 (0)