PyTorch环境的配置以及安装

大家好我是J哥,今天教大家由win配置pytorch,以及yolov5的配置。

首先在geihub上搜索yolov5选择第一个:https://github.com/ultralytics/yolov5

再从官网上下载anaconda,一定要添加环境变量(比较简单就不说了)

我选择的是5.0版本进行调试及环境搭建

PyTorch的 环境安装  conda create -n pytorch python3.7,
从base环境切换到pytorch环境 :conda activate pytorch

我们可以通过conda env list 查看所有环境

第一步就完成了,第二步下载Pytorch

访问 pytorch: https://pytorch.org/

 

 在这里输入复制的命令

 conda如果不配置镜像源会比较慢

下面我也给大家总结了 亲测有效

pip 源
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
conda 源
清华:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
中科大:
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/

下载完之后输入 pip list 可以查看我们下载的

第三步

根据从github上下载zip包新建一个项目

我们可以在pycharm最下面找到base终端

        首先切换到pytorch

        执行 pip install -r requirements.txt(这个是作者给我们提前封装好的)如果在这里遇到错误可以访问我补充文章:https://blog.csdn.net/duyun0/article/details/119578548

        pip之后运行 detect.py文件就可以了

 

nvidia-smi 查看显卡是否支持CUDA Driver Version: 457.56 版本

 欢迎大家积极留言,如果本篇文章对你有帮助那就给J哥一个三连 谢谢!

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

itLaity

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值