LoginSignup
0
0

More than 5 years have passed since last update.

Install Pytorch for windows

Last updated at Posted at 2018-07-09

1.Pytorchのサイトを参照

2. Get Started で、自分の環境を選択

PowerShellを開き、cmdでコマンドプロンプトにしてから、表示されたコマンドを実行

※以下は、windows & pip $ python 3.5 & CUDA 9.0 を選択した場合

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

3.以下のエラーが表示された場合

Could not install packages due to an EnvironmentError: raw write() returned invalid length 2 (should have been between 0 and 1)

win_unicode_consoleを先にインストールしてから、再度whlのインストールを実行

conda install -c anaconda win_unicode_console

参考:バグ回避策有り:Fall Creator Update (Win10) でpython が 「OSError: raw write() returned invalid length・」

4.Pytorchの動作確認

import torch
torch.__version__

5.以下のエラーがでる場合

>>> import torch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Anaconda3\lib\site-packages\torch\__init__.py", line 78, in <module>
from torch._C import *
ImportError: DLL load failed: このオペレーティング システムでは %1 は実行されません。

intel-openmpをインストール

conda install intel-openmp

参考:Pytorch on Windows gives ImportError

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0