Filter the None labels
diff --git a/utils/datasets.py b/utils/datasets.py
index 7ed8f5a1d80..338400e6340 100755
--- a/utils/datasets.py
+++ b/utils/datasets.py
@@ -375,7 +375,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r
         pbar = tqdm(self.label_files)
         for i, file in enumerate(pbar):
             l = self.labels[i]  # label
-            if l.shape[0]:
+            if l is not None and l.shape[0]:
                 assert l.shape[1] == 5, '> 5 label columns: %s' % file
                 assert (l >= 0).all(), 'negative labels: %s' % file
                 assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file



## 🛠️ PR Summary

<sub>Made with ❤️ by [Ultralytics Actions](https://github.com/ultralytics/actions)<sub>

### 🌟 Summary
Improved label loading robustness in dataset processing.

### 📊 Key Changes
- Added an additional check to verify that labels are not `None` before processing them.

### 🎯 Purpose & Impact
- **Purpose:** Prevent errors that could occur when a label file is empty or corrupted.
- **Impact:** Enhances the stability of dataset loading, reducing the likelihood of crashes during model training and evaluation due to problematic label data. This makes the YOLOv5 user experience more reliable for developers working on object detection tasks.