-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Medium PriorityShould be addressed in few daysShould be addressed in few daysbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
🐛 Bug
Describe the bug
I 'm training model with 2 class. Error appears at line 61 in metrics/accuracy.py
. By default, maxk
always equal 5 because topk
is fixed (1,5)
in train_step
and val_step
function. output
variable shape is 32x4
so result in error RuntimeError: invalid argument 5: k not in range for dimension
59 maxk = max(topk)
60 batch_size = target.size(0)
61 _, pred = output.topk(maxk, 1, True, True)
62 pred = pred.t()
63 correct = pred.eq(target.view(1, -1).expand_as(pred))
To Reproduce
Steps to reproduce the behavior:
Just train model using engine.fit
with 2 classes
Expected behavior
training process works with arbitrary number of output class
Desktop (please complete the following information):
- OS: ubuntu 20.04
Additional context
Metadata
Metadata
Assignees
Labels
Medium PriorityShould be addressed in few daysShould be addressed in few daysbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers