您的位置:首页 > 编程语言 > Python开发

Tensorflow+python3 常见运行问题及其解决方法

2018-02-27 16:56 615 查看
本文地址:http://blog.csdn.net/shanglianlm/article/details/79390615

1 SyntaxError: Missing parentheses in call to ‘print’

解决:python2支持 print “xxxx” ,python3需要使用print(“xxx”)

2 SyntaxError: multiple statements found while compiling a single statement

解决:多行代码直接在IDLE中编译,是每行都要回车的,或者新建一个py文件来运行。

3 ImportError: Could not find ‘cudart64_90.dll’.

ImportError: Could not find ‘cudart64_90.dll’. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit

解决:tensorflow只支持cuda9.0,下载9.0并安装。

4 ImportError: No module named ‘utils’

解决:pip install utils

5 NameError: name ‘xrange’ is not defined

解决:Python3中xrange改为range

6 ImportError: No module named ‘input_data’

解决:解决:下载input_data或者使用tensorflow自带的input_data

from tensorflow.examples.tutorials.mnist import input_data

7

解决:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python