This commit is contained in:
Glenn Jocher 2019-12-03 13:49:20 -08:00
parent 0dd0fa7938
commit fcdbd3ee35
1 changed files with 3 additions and 2 deletions

View File

@ -449,8 +449,9 @@ def build_targets(model, targets):
# Class
tcls.append(c)
if c.shape[0]: # if any targets
assert c.max() <= model.nc, 'Model accepts %g classes labeled from 0-%g, however you supplied a label %g. \
See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data' % (model.nc, model.nc - 1, c.max())
assert c.max() < model.nc, 'Model accepts %g classes labeled from 0-%g, however you labelled a class %g. ' \
'See https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data' % (
model.nc, model.nc - 1, c.max())
return tcls, tbox, indices, av