RuntimeError when trying to train my model!

The stacktrace points to an invalid indexing operation, so rerun your code via CUDA_LAUNCH_BLOCKING=1 python script.py args and isolate the failing line of code. Once done, make sure the index tensor contains valid indices.