Qengineering / YoloV8-ncnn-Raspberry-Pi-4

YoloV8 for a bare Raspberry Pi 4 or 5
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
109 stars 7 forks source link

The reporting of training errors. #9

Open vinson-xj opened 8 months ago

vinson-xj commented 8 months ago

Hello, may I ask if you have encountered the situation that training cannot be done after modifying block.py and head.py? The model exported after modification can indeed be used, but it seems to have an impact on normal training

AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n... AMP: checks failed ❌. Anomalies were detected with AMP on your system that may lead to NaN losses or zero-mAP results, so AMP will be disabled during training. train: Scanning D:\BaiduSyncdisk\CHENGXU\yolov8\ultralytics-main\ultralytics\Fruit_data\data_3new\image\apple.cache... 1170 images, 361 backgrounds, 0 corrupt: 100%|██████████| 1528/1528 [00:00<?, ?it/s] val: Scanning D:\BaiduSyncdisk\CHENGXU\yolov8\ultralytics-main\ultralytics\Fruit_data\data_3new\image\apple.cache... 1170 images, 361 backgrounds, 0 corrupt: 100%|██████████| 1528/1528 [00:00<?, ?it/s] PySide6/init.py: Unable to import Shiboken from D:\BaiduSyncdisk\CHENGXU\yolov8\ultralytics-main\ultralytics\Fruit_data, C:\Users\93748.conda\envs\yolov8\python38.zip, C:\Users\93748.conda\envs\yolov8\DLLs, C:\Users\93748.conda\envs\yolov8\lib, C:\Users\93748.conda\envs\yolov8, C:\Users\93748.conda\envs\yolov8\lib\site-packages, C:\Users\93748.conda\envs\yolov8\lib\site-packages\win32, C:\Users\93748.conda\envs\yolov8\lib\site-packages\win32\lib, C:\Users\93748.conda\envs\yolov8\lib\site-packages\Pythonwin Plotting labels to runs\detect\train13\labels.jpg... optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... optimizer: SGD(lr=0.01, momentum=0.9) with parameter groups 57 weight(decay=0.0), 64 weight(decay=0.0005), 63 bias(decay=0.0) 1500 epochs...

  Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
 1/1500      2.23G      0.795      3.674     0.9231         34        320: 100%|██████████| 48/48 [00:07<00:00,  6.26it/s]
             Class     Images  Instances      Box(P          R      mAP50  mAP50-95):   0%|          | 0/24 [00:00<?, ?it/s]

Traceback (most recent call last): File "D:\BaiduSyncdisk\CHENGXU\yolov8\ultralytics-main\ultralytics\Fruit_data\start.py", line 12, in results = model.train( File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\engine\model.py", line 390, in train self.trainer.train() File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\engine\trainer.py", line 208, in train self._do_train(world_size) File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\engine\trainer.py", line 427, in _do_train self.metrics, self.fitness = self.validate() File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\engine\trainer.py", line 546, in validate metrics = self.validator(self) File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\engine\validator.py", line 181, in call self.loss += model.loss(batch, preds)[1] File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\nn\tasks.py", line 258, in loss return self.criterion(preds, batch) File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\utils\loss.py", line 209, in call anchor_points, stride_tensor = make_anchors(feats, self.stride, 0.5) File "C:\Users\93748.conda\envs\yolov8\lib\site-packages\ultralytics\utils\tal.py", line 301, in makeanchors , _, h, w = feats[i].shape ValueError: not enough values to unpack (expected 4, got 2)