Skip to content

Commit

Permalink
val.py assert ncm == nc fix (ultralytics#8545)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored and Shivvrat committed Jul 12, 2022
1 parent 14e87dc commit e658227
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion val.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e658227

Please sign in to comment.