stanford-tensorflow-tutorials
stanford-tensorflow-tutorials copied to clipboard
03_logistic_regression_mnist, line 81, TypeError:
trafficstars
could someone tell me how to deal with it.
Traceback (most recent call last):
File "C:/Users/Jerin/PycharmProjects/pyflow/main.py", line 81, in
if you see the print accuracy_batch, you'll notice it is list. You should flatten to have the float number to add up.
total_correct_preds += accuracy_batch[0]
will work.
I have created a Pull Request #85 to fix this issue. I have explained what is happening in the Pull Request.
In a nutshell, the line (returns a list of 1 value):
accuracy_batch = sess.run([accuracy], ...)
needs to be changed to (returns a scalar):
accuracy_batch = sess.run(accuracy, ...)