NeuralNLP-NeuralClassifier icon indicating copy to clipboard operation
NeuralNLP-NeuralClassifier copied to clipboard

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

Open WZY009 opened this issue 1 year ago • 2 comments

能请问一下为什么跑自己的训练集就会出现这种问题吗

WZY009 avatar Dec 16 '24 05:12 WZY009

如果将model/rnn.py line 83的cpu()给去掉,则会出现: RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor

WZY009 avatar Dec 16 '24 05:12 WZY009

可以提供具体的命令和配置吗?

MagiaSN avatar Jan 21 '25 12:01 MagiaSN