win10 安装 Pytorch
一、安裝Pytorch
打開官方網址
https://pytorch.org/get-started/locally/#supported-windows-distributions
選擇合適版本,復制最下方命令到CMD中安裝
出現如下錯誤
于是根據上面的鏈接,手動去下載,打開
https://download.pytorch.org/whl/torch_stable.html
搜索 cu92/torch-1.2.0%2Bcu92-cp36-cp36m-win_amd64.whl
然后用迅雷下載.
之后用下面命令安裝 (注意文件名不要有空格)
之后驗證是否安裝成功,結果出錯如下:
查詢解決辦法,現在Python版本是3.6.0,所以升級Python版本
升級之后到了Python 3.6.2,再次驗證,問題解決!
>>> import torch >>> torch.__version__ '1.2.0+cu92'Additionally, to check if your GPU driver and CUDA is enabled and accessible by PyTorch, run the following commands to return whether or not the CUDA driver is enabled:
>>> torch.cuda.is_available() True二、安裝torchvision
首先用pip安裝失敗,安裝成功,但是導入時報錯from torch.C ......
torchvision ImportError: DLL load failed: 找不到指定的模塊。
之后從官網下載安裝包手動安裝成功
torchvision-0.4.0+cu92-cp36-cp36m-win_amd64.whl
https://download.pytorch.org/whl/torch_stable.html
三、清華鏡像源安裝
最開始使用conda方式安裝,結果出現下面問題
解決方法: 首先添加清華的鏡像源,然后再安裝
原本的命令如上圖,添加清華源之后
參考 https://blog.csdn.net/sunqiande88/article/details/80085569
(2020-2-3 未成功, Python現在是3.7之前3.6版本的torch沒法安裝了)
四、如何檢查顯卡支持哪個版本的CUDA ?
總結
以上是生活随笔為你收集整理的win10 安装 Pytorch的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Elasticsearch学习记录
- 下一篇: 图像处理与分析 计算机视觉 医学图像