-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Unhelpful CrossEntropyLoss dimension error message #1328
Copy link
Copy link
Open
Labels
module: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generalmodule: error checkingBugs related to incorrect/lacking error checkingBugs related to incorrect/lacking error checkingmodule: lossProblem is related to loss functionProblem is related to loss functiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
module: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generalmodule: error checkingBugs related to incorrect/lacking error checkingBugs related to incorrect/lacking error checkingmodule: lossProblem is related to loss functionProblem is related to loss functiontriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
I believe I've stumbled upon a slight whoops in nn.CrossEntropyLoss(). If the criterion is called with (a, y) where a in (N, C) and y in (N) such that some yi > C, I get the internal error message below (took a while to parse)... seems like this could use a wrapper. A simple note following the internal error would suffice--how about: "Ensure the class dimension of the predictions matches the class dimension of the targets" ?
THCudaCheck FAIL file=/py/conda-bld/pytorch_1490903321756/work/torch/lib/THC/generic/THCTensorCopy.c line=65 error=59 : device-side assert triggered
System: Ubuntu 16.06, Python 3.6 (conda install).
cc @ngimel