清华大学镜像源会导致tensorflow-gpu安装失败

笔者之前由于安装pytorch将清华大学信道加入,后来安装tensorflow-gpu始终安装的是tensorflow的cpu版本

1.查看安装的镜像

conda config --get channels

2.删除默认镜像

conda config --remove-key channels

3.然后重新安装tensorflow-gpu

conda install tensorflow-gpu=1.10

3.查看gpu是否调用成功

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 9864097557774494597
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 10738902631
locality {
  bus_id: 1
  links {
  }
}
incarnation: 3161576480591350016
physical_device_desc: "device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:18:00.0, compute capability: 7.5"
]

终端显示上述界面,则gpu版本安装成功

你可能感兴趣的:(tensorflow,深度学习,pytorch)