报错:C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\cuda\Indexing.cu:699: block: [9,0,0],

完整报错:

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字典大小与词表大小对比分析。


版权声明:本文为qq_37356556原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。