Ubuntu 搭建 yolov5

1、 下载并安装Miniconda

复制代码
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh

这一步其实也可以不要,conda是管理虚拟环境的,为了防止以后多个环境有冲突,建议安装。

接受两个仓库的服务条款:

复制代码
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r

2、创建 yolov5 环境

复制代码
conda create -n yolov5 python=3.8 -y

激活yolov5环境

复制代码
conda activate yolov5

3、下载torch

下载torch时进入torch官网,选择合适的版本,我选的cpu,如果有GPU可以选择GPU,和window搭建一致。

最后的 -i 网址是指定阿里云镜像,我试了试清华镜像和阿里云,在我这阿里云下载更快,不过不指定是直接从官网下载。

复制代码
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 -i https://mirrors.aliyun.com/pypi/simple

4、下载其他依赖包

复制代码
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

5、最终运行例子

相关推荐
toooooop820 小时前
如何用 ss + ps 精准定位本机 Redis 的“隐形”消费者?
linux·数据库·redis·缓存
重生的黑客21 小时前
Linux 进程程序替换与自定义 Shell:从 exec 函数族到命令行解释器
linux·运维·服务器·shell
北极糊的狐21 小时前
阿里云服务器-命令2-Linux 系统实时资源监视器 top 命令详解(进程级实时资源监控)
linux·运维·服务器
三言老师21 小时前
clear与history历史命令管理实操
linux·运维·服务器·网络·centos
味悲1 天前
Linux 环境下 DNS 服务器搭建
linux·运维·服务器
dok121 天前
Johannes 《Linux内核模块与设备驱动开发:编写Linux驱动程序》 (7)open,release (8) write read
linux
皮卡狮1 天前
进程间通信:认识匿名管道和进程池实现
linux
feasibility.1 天前
wsl安装Ubuntu方法(含网络不稳定处理)
linux·运维·windows·ubuntu
‎ദ്ദിᵔ.˛.ᵔ₎1 天前
linux进程
linux
湿滑路面1 天前
硅基聊天室——如何用supervisor优雅的管理服务进程
linux·前端·python