在Windows上安裝pytorch

來源:互聯網
上載者:User

標籤:ref   class   3.5   uda   ice   bsp   .com   anaconda   指定   

電腦環境為 :windows10 python3.5 cuda8.0

 

可以在官網查詢各個版本的安裝方式

這裡使用pip的安裝方式,通過以下命令:

1 pip3 install http://download.pytorch.org/whl/cu80/torch-0.4.0-cp35-cp35m-win_amd64.whl 2 pip3 install torchvision

在安裝完成後在python中驗證安裝:

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import torch>>> import torchvision>>>

 

 

可能出現的問題:

在import torch時出現 from torch._C import * ImportError: DLL load failed: 找不到指定的模組 的錯誤

原因是缺少一些dll檔案,通過以下幾步來解決:

1.下載 win-64/intel-openmp-2018.0.0-8.tar.bz2

 

2.將其解壓,並將其Library/bin檔案夾中的dll檔案全部放入python所在目錄的DLLs檔案夾下(例如C:\Users\qin\AppData\Local\Programs\Python\Python35\DLLs)

3.將上面的路徑添加進環境變數path中。

 

OK,完成

 

在Windows上安裝pytorch

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.