ubuntu 从刷机到yolov5环境搭建训练记录
ubuntu 从刷机到yolov5环境搭建训练记录
这两天需要一个模型检测一些摄像头内容,使用yolov5训练了一个模型,记录一下。
1. 刷机
具体步骤不描述,网上很多。
刷机时遇到一个问题,原有系统为centos7,1.刷机时选择格式化硬盘后,点击继续无反应,或者跳回上一步 2.选择自定义分区,安装过程中报错,无法控制硬盘;应该是因为centos7系统占用磁盘缘故,需进入ubuntu试用系统将磁盘格式化后再进行安装
2. 设置环境
设置root密码
sudo passwd root
更换源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list
替换里面的内容为
# source && source code
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-security main restricted universe multiverse
# Advance distribution source, Not recommended
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-proposed main restricted universe multiverse# source && source code
deb http://mirrors.aliyun.com/ubuntu hirsute main restricted
deb http://mirrors.aliyun.com/ubuntu hirsute-updates main restricted
deb http://mirrors.aliyun.com/ubuntu hirsute universe
deb http://mirrors.aliyun.com/ubuntu hirsute-updates universe
deb http://mirrors.aliyun.com/ubuntu hirsute multiverse
deb http://mirrors.aliyun.com/ubuntu hirsute-updates multiverse
deb http://mirrors.aliyun.com/ubuntu hirsute-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu hirsute-security main restricted
deb http://cn.archive.ubuntu.com/ubuntu hirsute-security universe
deb http://cn.archive.ubuntu.com/ubuntu hirsute-security multiverse
3. NVIDIA显卡驱动安装
3.1 在终端输入:ubuntu-drivers devices
可以看到显卡型号和推荐的显卡驱动
3.2 sudo apt update
升级一下apt
3.3 sudo apt install nvidia-driver-510
3.4 nvidia-smi
查看网卡使用情况
过程中遇到三个问题
- 使用一篇文章推荐的
sudo ubuntu-drivers autoinstall
会吃网卡驱动,需要重新装网卡驱动或者刷机 - 推荐的版本是470的版本,但是安装完成后输入
nvidia-smi
,提示NVIDIA-SMI hai failed because it couldn't com...
,上网搜可以找到一些解决方案,安装akms之类的 - 安装akms或者nvidia-driver-510会提示
无法修正错误,因为您要求某些软件包保持现状
,更改软件更新里的subscribed to为Security and ...
4.yolov5环境准备
4.1 python/pip/git安装,pip换源,具体步骤不描述。
4.2 安装conda
wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
bash /tmp/Anaconda3-2020.02-Linux-x86_64.sh
source ~/.bashrc
conda update --all
如果提示conda命令不存在需要配置conda环境变量
4.3 下载yolov5代码并测试
git clone https://github.com/ultralytics/YOLOv5
conda create --name yolotest python=3.9
source activate yolotest
pip install -r requirement.txt
4.4 安装cuda
这里使用conda安装,安装命令查询
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
4.5 测试
在虚拟环境中输入python detect.py
,等待执行完成,在yolov5/runs下查看结果表示成功
5.数据集准备
这里使用pip安装labelImg,pip install labelImg
在python/Scripts底下就直接有对应的可执行文件,运行就行了,至于怎么标注,[查看链接]((10条消息) 目标检测使用LabelImg标注VOC数据格式和YOLO数据格式——LabelImg使用详细教程_点亮~黑夜的博客-CSDN博客_labelimg yolo格式)
6.训练
打开train.py文件,更改几个常用的地方
parser.add_argument('--weights', type=str, default='', help='initial weights path')
parser.add_argument('--cfg', type=str, default='./models/loading.yaml', help='model.yaml path')
parser.add_argument('--data', type=str, default='data/loading.yaml', help='data.yaml path')
parser.add_argument('--epochs', type=int, default=300)
然后python train.py
就开始训练了
训练过程中可以输入命令tensorboard --logdir=runs
,启动网页查看实时结果,也可以使用nvidia或者top命令查看GUP/CPU使用情况
ubuntu 从刷机到yolov5环境搭建训练记录相关推荐
- 高版本Android真机逆向测试环境搭建
高版本Android真机逆向测试环境搭建 618购入了新机Xiaomi K50,真滴便宜又好用,续航很强界面很丝滑.正好拿来做逆向测试机? 怎么可能!这也太奢侈了!不过淘汰的Xiaomi Note 7 ...
- PyTorch+YOLOv5环境搭建(未完待续)
PyTorch+YOLOv5环境搭建 软硬件要求 1. PyTorch Requirements NVIDIA CUDA 9.2 or above NVIDIA cuDNN v7 or above h ...
- Ubuntu配置上位机Blackfin开发环境手记
Ubuntu配置上位机Blackfin开发环境手记 -------- 本文档适合使用Ctrl+F 搜索关键字 -------------- -------- It's more convenient ...
- Ubuntu 下无人机飞控 ArduPilot 开发环境搭建
Ubuntu 下无人机飞控 ArduPilot 开发环境搭建 Ubuntu 下无人机飞控 ArduPilot 开发环境搭建 操作流程 升级安装包 安装 git 克隆代码 安装交叉编译工具链 将编译器添 ...
- 环境搭建脚本记录(待开源等小伙伴补充)
环境搭建脚本记录 大数据组件安装顺序 JDK安装 静态ip配置 关闭防火墙 配置各主机之间免密登录 flume安装配置 Zookeeper单机安装配置 Zookeeper集群安装配置 Hadoop集群 ...
- nvidia TX2 CUDA yolov5环境搭建
本文记录笔者在 nvidia TX2 系统上搭建 yolov5 环境的过程. 注意说明的是,本文在文后的文章基础上进行实践,根据自己的经历进行描述和补充.由于能力有限,对本文涉及的知识和相关问题无法回 ...
- Nvidia TX2 刷机+深度学习环境配置(cuda 8.0+python 3.5+opencv 3.4+tensorflow 1.4.1+keras+pip3)
配置说明 一.刷机/重装系统 二.环境配置 三.参考 一.刷机/重装系统(系统损坏时可按以下步骤重装系统) 1)刷机之前的准备 (1)装有ubuntu16.04的电脑(主机),因为我们要安装的JetP ...
- Ubuntu Tensorflow object_detection API 目标检测环境搭建
Ubuntu 16.04下安装TensorFlow Object Detection API(对象检测API) Ubuntu 16.04下搭建TensorFlow运行环境(用Anaconda) ...
- Ubuntu下常用强化学习实验环境搭建(MuJoCo, OpenAI Gym, rllab, DeepMind Lab, TORCS, PySC2)
原文地址:http://blog.csdn.net/jinzhuojun/article/details/77144590 和其它的机器学习方向一样,强化学习(Reinforcement Learni ...
最新文章
- python编程入门课程视频-带学《Python编程:从入门到实践》
- 【python-numpy】工具包中np.random.choice()的用法详解及其参考
- [译] 前端组件设计原则
- 暑期社会实践服务器维护,寒假网络维护社会实践报告
- .net Redis缓存优化提高加载速度和服务器性能(二)
- Python入门教学之(标识符和保留字)
- 三星Galaxy Note 10系列价格曝光:顶配售价要破万
- SQLi LABS Less-19
- TCL语言笔记:TCL过程控制练习
- Python常用中文字体对应名称
- python 多行注释后可运行程序报错
- 第一章 模式识别基本概念
- 计算机网络技术广告,屏蔽QQ广告和迷你首页广告
- 应用统计学考研笔记1:数据整理与抽样
- Cannot load facet,unknow facet type web
- YTC, YTM, YTW
- 【leetcode】开密码锁
- 西门子PLC 冷启动、暖启动、热启动的一种通俗解释
- 计算机安全反思报告书,计算机数据安全教学反思.doc
- ui设计界面参数_参数化设计,可以更有效地设计用户界面