完整报错:
C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\cuda\Indexing.cu:699: block: [9,0,0], thread: [0,0,0] Assertion `srcIndex < srcSelectDimSize` failed.
输出embedding后的词向量后报错:
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
原因:初始化的Embedding词向量集合大小太小(必须要输入的要小),数据没有找到对应词向量,可查看word2index字典大小与词向量集合大小对比分析。