Closed
Description
Dear developers of LibAUC,
Thank you for open-sourcing your wonderful work! As I utilize the package's MultilabelAUCLoss for my multi-label classification task, I keep encountering an error: "IndexError: too many indices for tensor of dimension 1"
. I encounter the same error when running the provided example on the website:
loss_fn = MultiLabelAUCMLoss(margin=1.0, num_labels=10)
y_pred = torch.randn(32, 10, requires_grad=True)
y_true = torch.empty(32, dtype=torch.long).random_(2)
loss = loss_fn(y_pred, y_true)
I couldn't find more concrete examples regarding multi-label problems, I also tried to a few debuggings, including reshaping y_true
to (32, 1), send all of them into the same device. However, I've yet figured out how to feed the correct shapes to the loss.
My specific problem involves calculating loss between pred=(batch, 3) and label=(batch) for a 3-class classification.
Thank you!
Metadata
Metadata
Assignees
Labels
No labels