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

你可能感兴趣的:(pytorch,人工智能,python)