Tensorflow 2.1 + cudatoolkit 10.1 + cudnn 7.6深度学习框架,自用

        Tensorflow框架安装

第一步,创建激活环境

conda create -n tf python=3.7

        之后激活环境

conda activate tf

第二步,安装 cuda

第三步,安装 cudatoolkit

conda install cudatoolkit=10.1

 第四步,安装 cudnn

conda install cudnn=7.6

第五步,安装 tensorflow

conda install tensorflow-gpu==2.1

第六步,安装完成后,查看是否安装完成

conda activate tf #重新激活环境
import tensorflow as tf #调用tensorflow
tf.__version__ #查看版本

安装完成

第七步,安装 scipy

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

第八步,安装 numpy

numpy-1.21.6+mkl-cp37-cp37m-win_amd64.whl 提前下载好,指定路径安装

pip install numpy-1.21.6+mkl-cp37-cp37m-win_amd64.whl

第九步,安装 matplotlib

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

第十步,安装 sk-learn

pip install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple/

至此,深度学习框架完成,之后安装自己用的库即可。

第十一步,安装自己库

# Tensorflow库
pip install utils -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install keras==2.3.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/

# 两个框架都需要安装的
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install Pillow -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install labelme -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install h5py -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install tensorboard -i https://pypi.tuna.tsinghua.edu.cn/simple/

# torch附加库
pip install onnx -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install onnxsim -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install thop -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install torchsummary -i https://pypi.tuna.tsinghua.edu.cn/simple/

(一)Lableme 安装报错

        具体为其中 PyQt5-sip 安装出错

        方法一:我们直接去下载对应版本PyQt5-sip · PyPI,下载好后,指定路径安装即可

pip install PyQt5_sip-12.9.0-cp37-cp37m-win_amd64.whl

        方法二:电脑中搜索Windows PowerShell打开,输入

wget https://aka.ms/vs/17/release/vs_BuildTools.exe -o vs_BuildTools.exe ; cmd /c vs_BuildTools.exe

        安装默认C盘,不保留下载缓存。安装完毕后,再运行一遍命令

        成功

(二)Scipy 安装出错

        方法:我们直接去下载对应版本 Scipy,下载好后,指定路径安装即可

pip install scipy-1.10.1-cp38-cp38-win_amd64.whl

        如果之后还报错 ERROR: Could not install packages due to an OSError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'D:\\Anaconda3\\envs\\pytorch\\Lib\\site-packages\\scipy-1.10.1-cp38-cp38-win_amd64.whl' Consider using the `--user` option or check the permissions.

        一般为权限问题,更改代码

pip install scipy-1.10.1-cp38-cp38-win_amd64.whl --user

        成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值