RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is
生活随笔
收集整理的這篇文章主要介紹了
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
pytorch,pycharm下做項目遇到的一個小問題,報了如下錯誤:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
我的電腦沒有g(shù)pu,應(yīng)該這里的問題,然后我就改為cpu,問題解決
直接在報錯代碼加了如下語句:
map_location= 'cpu'總結(jié)
以上是生活随笔為你收集整理的RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机视觉学习(三):仿射变换将一幅图像
- 下一篇: 聚类kmeans案例