yolov5在Centos系统上部署的环境搭建

yolov5在Centos系统上部署的环境搭建

一.安装Anaconda3

1.下载Anaconda3安装包 :

https://repo.anaconda.com/archive/

wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh

 

2.执行安装命令:


bash Anaconda3-2018.12-Linux-x86_64.sh

3.选择安装路径:

Anaconda3 will now be installed into this location:/root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below

[/root/anaconda3] >>> /usr/local/anaconda3

4.选择是否安装VSCode,输入no来结束安装

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]>>> Please answer 'yes' or 'no':>>> no

5.配置环境变量

vi /etc/profile

在尾部加下如下

export PATH=/opt/module/anaconda3/bin:$PATH

按下esc再键入 :wq 保存退出

最后执行如下使环境变量生效


source /etc/profile

 

6.验证安装,输入如下命令:

 conda list

 

略........

7.创建python3环境


conda create -n pytorch python=3.7

8.切换到python3


source activate pytorch

二.安装pytorch的GPU版本

1.来到官网 https://pytorch.org/get-started/locally/

根据自己的环境,进行选择,网站会给出相应的安装命令。我这里的环境是linuxpipcuda 11.2

pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html


pip install ipython

 

 

安装完pytorch后,我们在ipython中查看安装的结果

 

 

说明GPU版本的pytorch安装成功

2.YOLOv5测试

首先还是把源码clone到本地

 

 

zip解压:

unzip yolov5_deepsort_car.zip

3.安装项目依赖:

(pytorch) [root@107 yolov5_deepsort_car]# pip install -r requirements.txt -i https://pypi.douban.com/simple

 

 

 

linux下安装Anaconda3如果遇到找不到bzip2:

 

 

 

解决办法:yum -y install bzip2

参考地址1:https://blog.csdn.net/u011435933/article/details/107045530/

参考地址3:https://xugaoxiang.com/2020/06/17/yolov5/

 

 

posted @ 2021-05-07 16:19  憨憨青年  阅读(1387)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css