Yolo整合
Yolo整合
helmet检测
准备数据集
kaggle中yolo格式的helmet数据集
导入yolo-v8
1 | import ultralytics |
安装cuda、torch…
….
[error]https://zzggo.com/2024/09/05/Yolo-fix/
准备yaml文件
1 | train: ... |
基于yolo-v8的coco模型训练helmet模型
1 | from ultralytics import YOLO |
编写测试文件
1 | from ultralytics import YOLO |
结果
附:
检查显卡可用性
1 | torch.cuda.is_available() |
torch.cuda.is_available()
False
nvcc -V 检查cuda版本
Known issue with inference using CPU on Windows for PyTorch 2.4.0
Fixes
- Downgrade PyTorch (CPU) to a previous version
1 | pip uninstall torch torchvision torchaudio -y |
- Install PyTorch with CUDA support, requires NVIDIA GPU with CUDA support
1 | pip uninstall torch torchvision torchaudio -y |
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ultralytics 8.2.87 requires torch<2.4.0,>=1.8.0; sys_platform == “win32”, but you have torch 2.4.1+cu121 which is incompatible.
1 | pip uninstall torch torchvision torchaudio -y |
yolo.document
**### [Yolo-v8_train]<**https://docs.ultralytics.com/modes/train/
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 ZG's Web!
评论