装历史版本不易~
conda install --channel https://conda.anaconda.org/hanyucui tensorflow-gpu=1.15
测试Cuda是否可用
python
import tensorflow as tf
tf.test.is_built_with_cuda()
测试GPU是否可用
tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)
方法2(2020-8-18)
pip install --upgrade setuptools #先更新一下pip,不然后面的安装有可能报错
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.8.0 #GPU版
验证、测试
import tensorflow as tf
a = tf.test.is_built_with_cuda() #判断CUDA是否可用
b = tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None) #判断GPU是否可用
print(a)
print(b)