Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
生活随笔
收集整理的這篇文章主要介紹了
Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原因是沒有把輸入數據類型轉為float類型
首先找到代碼出錯的位置,將該處的數據類型轉為float類型:
x = x.type(torch.FloatTensor)?
總結
以上是生活随笔為你收集整理的Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OpenCV学习笔记(三):多通道图像分
- 下一篇: python获取依赖包和安装依赖包