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

我的一个解决方法是降低torch的版本
出错误的版本:torch 1.13.0+cu117
不出错误的版本:torch 1.7.1+cu110
一个可以下载torch的网站

你可能感兴趣的:(深度学习,pytorch,人工智能)