|
@@ -1,7 +1,7 @@
|
|
## YOLO 采用命令训练数据集
|
|
## YOLO 采用命令训练数据集
|
|
|
|
|
|
```shell
|
|
```shell
|
|
-yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01 --device='0,1'
|
|
|
|
|
|
+yolo train data=coco128.yaml model=yolov8n.pt epochs=10 lr0=0.01 device='0,1'
|
|
|
|
|
|
yolo task=detect mode=train model=yolov8x.yaml data=mydata.yaml epochs=10 batch=16
|
|
yolo task=detect mode=train model=yolov8x.yaml data=mydata.yaml epochs=10 batch=16
|
|
|
|
|
|
@@ -23,6 +23,7 @@ yolo task=segment mode=predict model=yolov8x-seg.pt source='/kaggle/input/person
|
|
实际运行:
|
|
实际运行:
|
|
```shell
|
|
```shell
|
|
yolo train data=/home/jxft/datasets/hyd-action.yaml model=/home/jxft/datasets/yolov8/yolov8n.pt epochs=100 lr0=0.01
|
|
yolo train data=/home/jxft/datasets/hyd-action.yaml model=/home/jxft/datasets/yolov8/yolov8n.pt epochs=100 lr0=0.01
|
|
|
|
+yolo train data=/home/yiidata/datasets/hyd-action.yaml model=/home/yiidata/datasets/yolov8/yolov8n.pt epochs=10 lr0=0.01 device='0'
|
|
```
|
|
```
|
|
|
|
|
|
## YOLO 采用代码测试数据集
|
|
## YOLO 采用代码测试数据集
|
|
@@ -62,6 +63,57 @@ results = model.train( # 开始训练模型
|
|
)
|
|
)
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+## Q&A
|
|
|
|
+
|
|
|
|
+**1. 报错 RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasSgemm**
|
|
|
|
+
|
|
|
|
+报错日志:
|
|
|
|
+
|
|
|
|
+```log
|
|
|
|
+Transferred 319/355 items from pretrained weights
|
|
|
|
+TensorBoard: Start with 'tensorboard --logdir runs/detect/train3', view at http://localhost:6006/
|
|
|
|
+Freezing layer 'model.22.dfl.conv.weight'
|
|
|
|
+AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
|
|
|
|
+Traceback (most recent call last):
|
|
|
|
+ File "/usr/local/bin/yolo", line 8, in <module>
|
|
|
|
+ sys.exit(entrypoint())
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/cfg/__init__.py", line 582, in entrypoint
|
|
|
|
+ getattr(model, mode)(**overrides) # default args from model
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/model.py", line 667, in train
|
|
|
|
+ self.trainer.train()
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 198, in train
|
|
|
|
+ self._do_train(world_size)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 312, in _do_train
|
|
|
|
+ self._setup_train(world_size)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/trainer.py", line 256, in _setup_train
|
|
|
|
+ self.amp = torch.tensor(check_amp(self.model), device=self.device)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/utils/checks.py", line 655, in check_amp
|
|
|
|
+ assert amp_allclose(YOLO("yolov8n.pt"), im)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/utils/checks.py", line 642, in amp_allclose
|
|
|
|
+ a = m(im, device=device, verbose=False)[0].boxes.data # FP32 inference
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/model.py", line 176, in __call__
|
|
|
|
+ return self.predict(source, stream, **kwargs)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/model.py", line 444, in predict
|
|
|
|
+ self.predictor.setup_model(model=self.model, verbose=is_cli)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 297, in setup_model
|
|
|
|
+ self.model = AutoBackend(
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
|
|
|
|
+ return func(*args, **kwargs)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/nn/autobackend.py", line 144, in __init__
|
|
|
|
+ model = model.fuse(verbose=verbose)
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/nn/tasks.py", line 184, in fuse
|
|
|
|
+ m.conv = fuse_conv_and_bn(m.conv, m.bn) # update conv
|
|
|
|
+ File "/usr/local/python3/lib/python3.8/site-packages/ultralytics/utils/torch_utils.py", line 196, in fuse_conv_and_bn
|
|
|
|
+ fusedconv.bias.copy_(torch.mm(w_bn, b_conv.reshape(-1, 1)).reshape(-1) + b_bn)
|
|
|
|
+RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)`
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+Linux 系统,删除 LD_LIBRARY_PATH 环境变量即可解决。
|
|
|
|
+
|
|
|
|
+```shell
|
|
|
|
+unset LD_LIBRARY_PATH [1]
|
|
|
|
+```
|
|
|
|
+
|
|
## 参考
|
|
## 参考
|
|
|
|
|
|
- https://blog.csdn.net/qq_32892383/article/details/136505299
|
|
- https://blog.csdn.net/qq_32892383/article/details/136505299
|