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...
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)
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...
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)