val.py assert ncm == nc fix (#8545)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-07-11 15:09:42 +02:00
1 parent 526e650553
commit 7dafd1cb29
1 file changed
+1 -1
+1 -1
View File
@@ -164,7 +164,7 @@ def run(
if not training:
if pt and not single_cls: # check --weights are trained on --data
ncm = model.model.nc
assert ncm == nc, f'{weights[0]} ({ncm} classes) trained on different --data than what you passed ({nc} ' \
assert ncm == nc, f'{weights} ({ncm} classes) trained on different --data than what you passed ({nc} ' \
f'classes). Pass correct combination of --weights and --data that are trained together.'
model.warmup(imgsz=(1 if pt else batch_size, 3, imgsz, imgsz)) # warmup
pad = 0.0 if task in ('speed', 'benchmark') else 0.5