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

相关推荐
aigcapi4 小时前
RAG 系统的黑盒测试:从算法对齐视角解析 GEO 优化的技术指标体系
大数据·人工智能·算法
上进小菜猪5 小时前
基于深度学习的河道垃圾检测系统设计(YOLOv8)
人工智能
上天夭5 小时前
模型训练篇
人工智能·深度学习·机器学习
小徐Chao努力6 小时前
【Langchain4j-Java AI开发】09-Agent智能体工作流
java·开发语言·人工智能
Blossom.1186 小时前
AI编译器实战:从零手写算子融合与自动调度系统
人工智能·python·深度学习·机器学习·flask·transformer·tornado
Coder_Boy_6 小时前
SpringAI与LangChain4j的智能应用-(理论篇2)
人工智能·spring boot·langchain·springai
却道天凉_好个秋6 小时前
OpenCV(四十八):图像查找
人工智能·opencv·计算机视觉
Coder_Boy_6 小时前
SpringAI与LangChain4j的智能应用-(理论篇3)
java·人工智能·spring boot·langchain
GetcharZp6 小时前
工地“火眼金睛”!手把手带你用 YOLO11 实现安全帽佩戴检测
人工智能·计算机视觉
Codebee6 小时前
Ooder A2UI架构白皮书
人工智能·响应式编程