【发布时间】:2019-06-20 04:57:21
【问题描述】:
我是 Pytorch 的新手,遇到这个错误:
x.gather(1, c)
RuntimeError:聚集时的索引无效 /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:457
以下是有关张量的一些信息:
print(x.size())
print(c.size())
print(type(x))
print(type(c))
torch.Size([128, 2])
torch.Size([128, 1])
<class 'torch.Tensor'>
<class 'torch.Tensor'>
x 用浮点值填充,c 用整数填充,这可能是问题吗?
【问题讨论】:
标签: python deep-learning pytorch