在conda虚拟环境中安装旧版本tensorflow-gpu 1.4报错该如何解决?
安装tensorflow-gpu 1.4的操作步骤
前置说明
tensorflow-gpu 1.4强制匹配cuda 8.0、cudnn 6.0,无需手动在系统层安装这两个依赖,conda会自动在虚拟环境内部署。
步骤1:创建纯净Python3.6虚拟环境
避免多依赖同时指定引发的解析冲突,先单独创建基础环境:
conda create -n tf_1_4 python=3.6 -y
创建完成后激活环境:
conda activate tf_1_4
步骤2:安装匹配版本的CUDA和cuDNN
在激活的虚拟环境内执行:
conda install cudatoolkit=8.0 cudnn=6.0 -y
步骤3:安装tensorflow-gpu 1.4
conda官方源的旧版本tensorflow依赖适配存在缺陷,改用pip安装:
pip install tensorflow-gpu==1.4
如果下载速度慢,可自行指定国内pypi镜像源加速。
验证安装
执行以下命令,返回True即为安装成功:
python -c "import tensorflow as tf; print(tf.test.is_gpu_available())"
内容的提问来源于stack exchange,提问作者rif3aa dev
相关产品推荐
相关产品推荐

