Open cloudwarn opened 6 years ago
(Tensorflow) C:\Users\uxb\Desktop\ChatBotCourse-master\ChatBotCourse-master\chat botv5>python demo.py train File "demo.py", line 189 print 'step=', step, 'loss=', loss_ret, 'learning_rate=', learning_rate.eval () ^ SyntaxError: invalid syntax
(Tensorflow) C:\Users\uxb\Desktop\ChatBotCourse-master\ChatBotCourse-master\chat botv5>python demo.py predict File "demo.py", line 189 print 'step=', step, 'loss=', loss_ret, 'learning_rate=', learning_rate.eval () ^ SyntaxError: invalid syntax
这个是python2的语法。 所有的print适配成python3的语法即可print(xxx)
还有xrange需要替换成range, unicode类型需要替换成str,经替换后在python3上可以运行了。
好,谢谢
(Tensorflow) C:\Users\uxb\Desktop\ChatBotCourse-master\ChatBotCourse-master\chat botv5>python demo.py train File "demo.py", line 189 print 'step=', step, 'loss=', loss_ret, 'learning_rate=', learning_rate.eval () ^ SyntaxError: invalid syntax
(Tensorflow) C:\Users\uxb\Desktop\ChatBotCourse-master\ChatBotCourse-master\chat botv5>python demo.py predict File "demo.py", line 189 print 'step=', step, 'loss=', loss_ret, 'learning_rate=', learning_rate.eval () ^ SyntaxError: invalid syntax