Open jerinw opened 7 years ago
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, ...)
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
total_correct_preds += accuracy_batch
TypeError: unsupported operand type(s) for +=: 'int' and 'list'