美文网首页
Expected object of device type c

Expected object of device type c

作者: 鼓鼓06 | 来源:发表于2021-11-01 20:54 被阅读0次
    1. 模型是否放到了CUDA上 model = model.to(device) 或 model = model.cuda(device)
    2. 输入数据是否放到了CUDA上 data = data.to(device) 或 data = data .cuda(device)
    3. 模型内部新建的张量是否放到了CUDA上 p = torch.tensor([1]).cuda(device) 或 p = torch.tensor([1]).cuda(device)

    这次的错误在于第三点,但是使用了方程,目前来说调用了别人的方程库,下一步研究怎么把别人的库放入cuda中。

    相关文章

      网友评论

          本文标题:Expected object of device type c

          本文链接:https://www.haomeiwen.com/subject/rtozaltx.html