Verify dataset >= batch size on INT8 export calibration (#18611)
Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
b04f6ae28f
commit
02e4e984a1
1 changed files with 5 additions and 1 deletions
|
|
@ -452,7 +452,11 @@ class Exporter:
|
|||
batch_size=batch,
|
||||
)
|
||||
n = len(dataset)
|
||||
if n < 300:
|
||||
if n < self.args.batch:
|
||||
raise ValueError(
|
||||
f"The calibration dataset ({n} images) must have at least as many images as the batch size ('batch={self.args.batch}')."
|
||||
)
|
||||
elif n < 300:
|
||||
LOGGER.warning(f"{prefix} WARNING ⚠️ >300 images recommended for INT8 calibration, found {n} images.")
|
||||
return build_dataloader(dataset, batch=batch, workers=0) # required for batch loading
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue