lcdevelop / ChatBotCourse

自己动手做聊天机器人教程
https://www.lcsays.com
MIT License
5.92k stars 1.69k forks source link

File "demo.py", line 189 #13

Open cloudwarn opened 6 years ago

cloudwarn commented 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

ahumoon7421 commented 6 years ago

这个是python2的语法。 所有的print适配成python3的语法即可print(xxx)

ahumoon7421 commented 6 years ago

还有xrange需要替换成range, unicode类型需要替换成str,经替换后在python3上可以运行了。

cloudwarn commented 6 years ago

好,谢谢