glenn-jocher commited on
Commit
7dafd1c
1 Parent(s): 526e650

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

Browse files
Files changed (1) hide show
  1. val.py +1 -1
val.py CHANGED
@@ -164,7 +164,7 @@ def run(
164
  if not training:
165
  if pt and not single_cls: # check --weights are trained on --data
166
  ncm = model.model.nc
167
- assert ncm == nc, f'{weights[0]} ({ncm} classes) trained on different --data than what you passed ({nc} ' \
168
  f'classes). Pass correct combination of --weights and --data that are trained together.'
169
  model.warmup(imgsz=(1 if pt else batch_size, 3, imgsz, imgsz)) # warmup
170
  pad = 0.0 if task in ('speed', 'benchmark') else 0.5
 
164
  if not training:
165
  if pt and not single_cls: # check --weights are trained on --data
166
  ncm = model.model.nc
167
+ assert ncm == nc, f'{weights} ({ncm} classes) trained on different --data than what you passed ({nc} ' \
168
  f'classes). Pass correct combination of --weights and --data that are trained together.'
169
  model.warmup(imgsz=(1 if pt else batch_size, 3, imgsz, imgsz)) # warmup
170
  pad = 0.0 if task in ('speed', 'benchmark') else 0.5