Add train.py `--img-size` floor
diff --git a/train.py b/train.py
index b1afaf8ada7..9a844ebac0d 100644
--- a/train.py
+++ b/train.py
@@ -207,7 +207,7 @@ def train(hyp,  # path/to/hyp.yaml or hyp dictionary
     # Image sizes
     gs = max(int(model.stride.max()), 32)  # grid size (max stride)
     nl = model.model[-1].nl  # number of detection layers (used for scaling hyp['obj'])
-    imgsz = check_img_size(opt.imgsz, gs)  # verify imgsz is gs-multiple
+    imgsz = check_img_size(opt.imgsz, gs, floor=gs * 2)  # verify imgsz is gs-multiple
 
     # DP mode
     if cuda and RANK == -1 and torch.cuda.device_count() > 1:
diff --git a/utils/general.py b/utils/general.py
index 08a3ff6539b..fabd0f35fe9 100755
--- a/utils/general.py
+++ b/utils/general.py
@@ -181,11 +181,11 @@ def check_requirements(requirements='requirements.txt', exclude=()):
         print(emojis(s))  # emoji-safe
 
 
-def check_img_size(img_size, s=32):
+def check_img_size(img_size, s=32, floor=0):
     # Verify img_size is a multiple of stride s
-    new_size = make_divisible(img_size, int(s))  # ceil gs-multiple
+    new_size = max(make_divisible(img_size, int(s)), floor)  # ceil gs-multiple
     if new_size != img_size:
-        print('WARNING: --img-size %g must be multiple of max stride %g, updating to %g' % (img_size, s, new_size))
+        print(f'WARNING: --img-size {img_size} must be multiple of max stride {s}, updating to {new_size}')
     return new_size
 
 



## 🛠️ PR Summary

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

### 🌟 Summary
Enhanced image size verification to ensure compatibility with the model's stride.

### 📊 Key Changes
- Modified the `check_img_size` function to include a `floor` argument.
- Adjusted the image size calculation to respect the new `floor` value alongside the maximum stride.

### 🎯 Purpose & Impact
- **Purpose**: Ensures that the input image size is not only a multiple of the model's stride but also not below a minimum size threshold, improving model compatibility.
- **Impact**: Users may notice a change in the minimum image size used for training, potentially leading to more consistent performance and avoiding errors related to incompatible image sizes. 📈🛠️