RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Ten

问题:

RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function i [CUDATensorId, CPUTensorId, VariableTensorId]

出问题处的函数栈如下图。

从函数栈中可以看出最后一个函数是torch.cat([...]),所以问题出现在这个函数中。此外这个函数也是我们自己使用,而不是库内部函数,因此我们可以检查一下这个函数的用法、函数参数是否正确。经查,在使用中函数参数results不是一个tensor列表,然后再结合Error提示,you passed an empty list of Tensors,所以确定问题是函数的使用。如图,也就是results有问题。然后将results进行修改即可,改成[tensor1, tensor2, tensor3, ...]形状的列表。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值