win10 NVIDIA GeForce GTX 950M安装安装tensorflow_gpu_1.9.0和和torch_1.1.0
迫于计算需求,最近将笔记本上的GPU也利用了起来。CUDA+CuDNN+TensorFlow部分参考了博文,感谢博主让我少走了很多弯路。Torch部分尝试了多种方法未果,最后凭借经验
完成了torch1.1.0和torchvision0.4.1的安装。
硬件配置硬件配置
显卡:NVIDIA GeForce GTX 950M
Python:3.6.2
CUDA:9.0 -> cuda_9.0.176_win10
CuDNN:9.0 -> cudnn-9.0-windows10-x64-v7.6.5.32
参考链接:https://blog.csdn.net/weixin_43741442/article/details/84260575
安装安装TensorFlow
pip install tensorflow_gpu==1.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
检验检验TensorFlow是否安装成功是否安装成功
import tensorflow as tf
sess = tf.Session()
a = tf.constant(1)
b = tf.constant(2)
print(sess.run(a+b))
运行结果运行结果
安装安装PyTorch
pip install http://download.pytorch.org/whl/cu90/torch-1.1.0-cp36-cp36m-win_amd64.whl
安装安装torchvision
下载torchvision-0.4.1-cp36-cp36m-win_amd64.whl,下载链接
安装torchvision,使用命令pip install torchvision-0.4.1-cp36-cp36m-win_amd64.whl
检验是否安装成功检验是否安装成功
import torch
torch.cuda.is_available() # 检验GPU是否可用
import torchvision
作者:rogeroyer
评论0