llSourcell / tensorflow_demo

Tensorflow Demo for my TF in 5 Min Video on Youtube
229 stars 175 forks source link

When I run python board.py #9

Open agan112 opened 7 years ago

agan112 commented 7 years ago

File "board.py", line 74 print "Iteration:", '%04d' % (iteration + 1), "cost=", "{:.9f}".format(avg_cost) ^ SyntaxError: invalid syntax

skandix commented 7 years ago

seems like you are using python3.. this error is due to the lack of parentheses around the print statement.. it should look something like this

print ("Iteration:", '%04d' % (iteration + 1), "cost=", "{:.9f}".format(avg_cost))

SheldonGeek commented 7 years ago

I had the same issue. This is caused by python version 3. The project needs python 2 to run. So I setup a conda virtual environment with python 2.7 and tensorFlow for python 2.7 to fix this issue. After you fix this, you will have multiple other issues such as TypeError: only integer scalar arrays can be converted to a scalar index. I will comment on another post about how I fixed it.

BenjaminFunklin commented 7 years ago

https://stackoverflow.com/questions/24405561/how-to-install-2-anacondas-python-2-7-and-3-4-on-mac-os-10-9

This should help out with that issue adding to what SheldonGeek said