ubuntu24.04+5070ti训练yolo模型(2)

三、cuda安装

sudo apt install nvidia-cuda-toolkit

也可通过官网下载cuda和cudnn最新版本手动安装

安装后查看

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2023 NVIDIA Corporation

Built on Fri_Jan__6_16:45:21_PST_2023

Cuda compilation tools, release 12.0, V12.0.140

Build cuda_12.0.r12.0/compiler.32267302_0

四、yolo模型训练

下载模型https://github.com/ultralytics/ultralytics

pip install ultralytics

出现error: externally-managed-environment

这个错误信息表明你正在尝试在一个由Ubuntu系统或某些系统级服务管理的Python环境中使用pip来安装包,而这个环境是"外部管理"的,意味着它可能已经被Ubuntu的某些部分或其他系统级服务所依赖。直接在这个环境中使用pip安装或更新包可能会破坏这些系统级服务或应用的运行。

sudo apt install python3-venv

建立虚拟环境yolo:python3 -m venv yolo

激活:source yolo/bin/activate

再次安装正常pip install ultralytics

训练参照说明即可。

Build a new model from YAML and start training from scratch

yolo detect train data=coco8.yaml model=yolo11n.yaml epochs=100 imgsz=640

Start training from a pretrained *.pt model

yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640

Build a new model from YAML, transfer pretrained weights to it and start training

yolo detect train data=coco8.yaml model=yolo11n.yaml pretrained=yolo11n.pt epochs=100 imgsz=640

在训练yolo11x模型时 torch.OutOfMemoryError: CUDA out of memory.

查看batch默认值为16,改为12正常

yolo detect train data=yoloDjW.yaml model=yolo11x.yaml epochs=100 imgsz=640 batch=12

相关推荐
leo在掘金1 小时前
从DeepSeek 510亿融资到GitHub 33K Star开源项目:这周的技术生态发生了什么?
人工智能
小姜前线技术3 小时前
AI流式渲染打字机效果抖动?节流方案踩坑实录
人工智能
用户018349301693 小时前
AI对话状态管理:useReducer还是XState
人工智能
先锋部队3 小时前
给AI对话加「停止生成」按钮:abort SSE实战
人工智能
新新技术迷3 小时前
移动端H5接AI对话的坑:键盘顶起与滚动到底
人工智能
aqi006 小时前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
用户5191495848457 小时前
libcurl Headers API 释放后重利用漏洞:跨请求复用头句柄导致堆内存安全风险
人工智能·aigc
踩蚂蚁7 小时前
自定义语音唤醒词:从训练到部署的完整链路实践
人工智能