当前位置:   article > 正文

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

notimplementederror: there were no tensor arguments to this function (e.g.,

问题:

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, ...]形状的列表。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/57730
推荐阅读
相关标签
  

闽ICP备14008679号