I encountered this error during pytorch training. Check the reason is indeed that the label is out of bounds. This is related to the Python starting from 0. The label needs to be handled carefully. But what I want to explain here is not this, but I am predicting where the label is out of bounds? ?
The following explains how to handle this error:
RuntimeError: CUDA error: device-side assert triggered
After the above two parts, the problem can basically be solved. good luck!