NVIDIA GeForce MX150 的Win10安装TensorFlow-GPU教程

NVIDIA GeForce MX150 的Win10安装TensorFlow-GPU教程

(1)主要步骤可以参考。https://blog.****.net/qq_36026791/article/details/88793488
(2)在参考上述教程的同时,结合以下几点安装TensorFlow时的注意事项,应该会帮你节省一些时间。

  1. TensorFlow-GPU的安装和CUDA、CUDNN的安装顺序没有前后之分,所以建议先安装TensorFlow。在安装完TensorFlow之后,输入 输入python进入Python环境,使用import TensorFlow as tf,这时会出现类似这样的错误NVIDIA GeForce MX150 的Win10安装TensorFlow-GPU教程
    这里会提示你安装对应的CUDA版本。我第一次按照上述教程的顺序安装,结果提示TensorFlow需要CUDA9.0,而我根据自己的driver版本安装了CUDA9.1。
    总结一下,CUDA版本的选择可以参考你下载的TensorFlow,然后≤NVIDIA CUDA driver的版本,低于你的driver版本没关系,应该是可以向下兼容的。
    TensorFlow版本和CUDA版本大致对应关系可参照下图
    NVIDIA GeForce MX150 的Win10安装TensorFlow-GPU教程
  2. 在安装TensorFlow前对anaconda设置镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

conda config --add channels
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes
否则,安装时会出现类似问题CondaHTTPError:
HTTP 000 CONNECTION FAILED for url
NVIDIA GeForce MX150 的Win10安装TensorFlow-GPU教程
这样做的原因是,不设置镜像源,anaconda默认会访问国外的网站进行下载,有可能网速慢或者翻不过去。

3.建议安装tensorflow-gpu时使用的命令(都是在创建的虚拟环境下运行)
①从镜像更新pip以防出现Readtimeout问题
pip --timeout=500 install --upgrade pip -i https://pypi.douban.com/simple
②python -m pip --timeout=100 install tensorflow-gpu==1.7.0 –i https://pypi.douban.com/simple --trusted-host pypi.douban.com
其中设置timeout的原因也是以防出现ReadTimeoutError。使用镜像更新或下载包可避免超时或http连接问题。

按照以上两步安装TensorFlow还可能解决出现的这种错误
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
(出现这种问题的原因还可能是你命令输入的有问题,一定注意空格,“-”的个数不能少)

这是我的第一篇****博客,如有疏漏之处,还请多多指教!