modelscope-funasr这个问题怎么解决?Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.DoubleTensor instead (while checking arguments for embedding)
https://github.com/alibaba-damo-academy/FunASR/issues/1386
打扰一下,我看到了这个issue,pull了新的代码pip install了,还是有这个问题。
torch:1.10.1
funasr:1.11
这个问题可能是由于在模型中使用了错误的数据类型导致的。根据错误信息,期望的张量类型是Long或Int,但是得到的是torch.cuda.DoubleTensor类型。
要解决这个问题,你可以尝试将输入数据的类型转换为Long或Int类型。你可以使用PyTorch中的to()
方法或者type()
方法来实现这个转换。例如:
input_tensor = input_tensor.to(torch.long)
或者
input_tensor = input_tensor.type(torch.LongTensor)
请确保在进行类型转换之前,你已经将输入数据移动到了GPU上(如果需要的话)。希望这可以帮助你解决问题!