Skip to content

Commit

Permalink
int(mlc) (ultralytics#4385)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Aug 11, 2021
1 parent 3b250e1 commit 5f35b06
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 @@ -204,7 +204,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
hyp=hyp, augment=True, cache=opt.cache, rect=opt.rect, rank=RANK,
workers=workers, image_weights=opt.image_weights, quad=opt.quad,
prefix=colorstr('train: '))
mlc = np.concatenate(dataset.labels, 0)[:, 0].max() # max label class
mlc = int(np.concatenate(dataset.labels, 0)[:, 0].max()) # max label class
nb = len(train_loader) # number of batches
assert mlc < nc, f'Label class {mlc} exceeds nc={nc} in {data}. Possible class labels are 0-{nc - 1}'

Expand Down

0 comments on commit 5f35b06

Please sign in to comment.