Skip to content

Commit

Permalink
update train.py class count assertion #424
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 19, 2020
1 parent 65857ad commit 912c06a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def train(hyp):
hyp=hyp, augment=True, cache=opt.cache_images, rect=opt.rect)
mlc = np.concatenate(dataset.labels, 0)[:, 0].max() # max label class
nb = len(dataloader) # number of batches
assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Correct your labels or your model.' % (mlc, nc, opt.cfg)
assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Possible class labels are 0-%g' % (mlc, nc, opt.cfg, nc - 1)

# Testloader
testloader = create_dataloader(test_path, imgsz_test, batch_size, gs, opt,
Expand Down

0 comments on commit 912c06a

Please sign in to comment.