Assertion `srcIndex < srcSelectDimSize` failed解决方法

C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [64,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [65,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [66,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [67,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [68,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
C:\w\b\windows\pytorch\aten\src\ATen\native\cuda\Indexing.cu:646: block: [0,0,0], thread: [69,0,0] Assertion `srcIndex < srcSelectDimSize` failed.

原因是数组索引越界,但是我的数据有多个数组,我也没看出来是哪个数组越界,可以直接把device换成cpu,就能直接帮你定位是哪个数组越界。

你可能感兴趣的:(Python,python,深度学习)