Anaconda下搭建Tensorflow2.1.0

1.安装Anaconda

Anaconda安装包下载路径:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

注意事项1:Select Installation Type (Just Me 和 All Users),选择Just me就好了。

注意事项2:Advanced Installation Options两个选项都勾选

遇到问题:

(1)下载的是Anaconda3-2019.10-windows-x86_x64.exe安装以后没有python,开始目录中也没有命令

          解决办法1:找个低版本的重新安装,现在安装的版本为Anaconda3.4.2。

          解决办法2:换了个电脑进行安装,好了

(2)开始目录中没有命令解决方法参考:https://blog.csdn.net/sinat_34734636/article/details/89787217

2. Tensorflow安装

(1)清华镜像仓库安装tensorflow的安装环境python

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda create -n tensorflow python=3.5

注:安装python3.7失败,电脑提示加密文件失败,可能是电脑加密系统的原因。

(2)激活当前的环境

activate tensorflow

(3)安装Tensorflow

(3.1 安装cpu版本的)

//通过清华镜像的pypi进行安装
pip install tensorflow --user -i https://pypi.tuna.tsinghua.edu.cn/simple

(3.2)安装GPU版本的Tensorflow 

a. 查看NVIDA显卡的NVIDA Compute Capability

b. 查看显卡是否安装了驱动程序

c. 安装CUDA Toolkit和cuDNN,必须严格按照TensorFlow官网说明的版本安装,对于TensorFlow2.1,可使用下列版本

conda install cudatoolkit=10.1
conda install cudnn=7.6.5

d. 安装tensorflow-gpu

conda install tensorflow-gpu

 

(4)若出现无法加载的DLL,请下载vc_redist.x64.exe,安装即可解决问题 。

 

3. 安装opencv库

pip install opencv-python --user -i https://pypi.tuna.tsinghua.edu.cn/simple

 Anaconda下搭建Tensorflow2.1.0_第1张图片

4. 安装强化学习GYM库

pip install gym --user -i https://pypi.tuna.tsinghua.edu.cn/simple

5. 安装PIL模块

pip install Pillow --user -i https://pypi.tuna.tsinghua.edu.cn/simple

参考:https://blog.csdn.net/qq_41895190/article/details/102956429

你可能感兴趣的:(Tensorflow)