windows pytorch installation record

conda create -n pytorch python=3.7
done
#
# To activate this environment, use
#
#     $ conda activate pytorch
#
# To deactivate an active environment, use
#
#     $ conda deactivate


C:\Users\PC>conda activate pytorch

(pytorch) C:\Users\PC>conda create -name --name pytorch python=3.7

(pytorch) C:\Users\PC>

(pytorch) C:\Users\PC>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Warning: 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' already in 'channels' list, moving to the top

(pytorch) C:\Users\PC>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

(pytorch) C:\Users\PC>conda config --set show_channel_urls yes

(pytorch) C:\Users\PC>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

(pytorch) C:\Users\PC>

(pytorch) C:\Users\PC>conda install pytorch torchvision cudatoolkit=11.1
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - cudatoolkit = 11.1

Current channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

(pytorch) C:\Users\PC>conda install pytorch torchvision cudatoolkit=10.1
Collecting package metadata (current_repodata.json): done
Solving environment: \
Warning: >10 possible package resolutions (only showing differing packages):
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0
  - http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::intel-openmp-2020.2-254, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3, http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0
  ... and othedone

## Package Plan ##

  environment location: d:\ProgramData\Anaconda3\envs\pytorch

  added / updated specs:
    - cudatoolkit=10.1
    - pytorch
    - torchvision


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    freetype-2.10.4            |       hd328e21_0         466 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libtiff-4.1.0              |       h56a325e_1         739 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libuv-1.40.0               |       he774522_0         255 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    lz4-c-1.9.2                |       hf4a77e7_3         106 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ninja-1.10.2               |   py37h6d14046_0         246 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pillow-8.1.0               |   py37h4fa10fc_0         663 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pytorch-1.7.1              |py3.7_cuda101_cudnn7_0       746.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
    tk-8.6.10                  |       he774522_0         2.7 MB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    torchvision-0.8.2          |       py37_cu101         7.2 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
    typing_extensions-3.7.4.3  |             py_0          28 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    xz-5.2.5                   |       h62dcd97_0         244 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    zstd-1.4.5                 |       h04227a9_0         456 KB  http://mirror.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:       759.5 MB

The following NEW packages will be INSTALLED:

  blas               anaconda/pkgs/main/win-64::blas-1.0-mkl
  cudatoolkit        anaconda/pkgs/main/win-64::cudatoolkit-10.1.243-h74a9793_0
  freetype           anaconda/pkgs/main/win-64::freetype-2.10.4-hd328e21_0
  intel-openmp       anaconda/pkgs/main/win-64::intel-openmp-2020.2-254
  jpeg               anaconda/pkgs/main/win-64::jpeg-9b-hb83a4c4_2
  libpng             anaconda/pkgs/main/win-64::libpng-1.6.37-h2a8f88b_0
  libtiff            anaconda/pkgs/main/win-64::libtiff-4.1.0-h56a325e_1
  libuv              anaconda/pkgs/main/win-64::libuv-1.40.0-he774522_0
  lz4-c              anaconda/pkgs/main/win-64::lz4-c-1.9.2-hf4a77e7_3
  mkl                anaconda/pkgs/main/win-64::mkl-2020.2-256
  mkl-service        anaconda/pkgs/main/win-64::mkl-service-2.3.0-py37h196d8e1_0
  mkl_fft            anaconda/pkgs/main/win-64::mkl_fft-1.2.0-py37h45dec08_0
  mkl_random         anaconda/pkgs/main/win-64::mkl_random-1.1.1-py37h47e9c7a_0
  ninja              anaconda/pkgs/main/win-64::ninja-1.10.2-py37h6d14046_0
  numpy              anaconda/pkgs/main/win-64::numpy-1.19.2-py37hadc3359_0
  numpy-base         anaconda/pkgs/main/win-64::numpy-base-1.19.2-py37ha3acd2a_0
  olefile            anaconda/pkgs/main/win-64::olefile-0.46-py37_0
  pillow             anaconda/pkgs/main/win-64::pillow-8.1.0-py37h4fa10fc_0
  pytorch            anaconda/cloud/pytorch/win-64::pytorch-1.7.1-py3.7_cuda101_cudnn7_0
  six                anaconda/pkgs/main/win-64::six-1.15.0-py37haa95532_0
  tk                 anaconda/pkgs/main/win-64::tk-8.6.10-he774522_0
  torchvision        anaconda/cloud/pytorch/win-64::torchvision-0.8.2-py37_cu101
  typing_extensions  anaconda/pkgs/main/noarch::typing_extensions-3.7.4.3-py_0
  xz                 anaconda/pkgs/main/win-64::xz-5.2.5-h62dcd97_0
  zstd               anaconda/pkgs/main/win-64::zstd-1.4.5-h04227a9_0


Proceed ([y] / n)? and


Downloading and Extracting Packages
typing_extensions-3. | 28 KB     | ################################################################################################################################################################################################# | 100%
freetype-2.10.4      | 466 KB    | ################################################################################################################################################################################################# | 100%
xz-5.2.5             | 244 KB    | ################################################################################################################################################################################################# | 100%
libtiff-4.1.0        | 739 KB    | ################################################################################################################################################################################################# | 100%
zstd-1.4.5           | 456 KB    | ################################################################################################################################################################################################# | 100%
tk-8.6.10            | 2.7 MB    | ################################################################################################################################################################################################# | 100%
torchvision-0.8.2    | 7.2 MB    | ################################################################################################################################################################################################# | 100%
libuv-1.40.0         | 255 KB    | ################################################################################################################################################################################################# | 100%
pillow-8.1.0         | 663 KB    | ################################################################################################################################################################################################# | 100%
ninja-1.10.2         | 246 KB    | ################################################################################################################################################################################################# | 100%
pytorch-1.7.1        | 746.5 MB  | #########3    


(pytorch) C:\Users\PC>where pthon
information: The file cannot be found using the provided pattern.

(pytorch) C:\Users\PC>where python
d:\ProgramData\Anaconda3\envs\pytorch\python.exe
d:\ProgramData\Anaconda3\python.exe
C:\Users\PC\AppData\Local\Microsoft\WindowsApps\python.exe

(pytorch) C:\Users\PC>

Summary, my computer 

C:\Users\PC>nvidia-smi
Sun Dec 27 07:36:56 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 456.71       Driver Version: 456.71       CUDA Version: 11.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2060   WDDM  | 00000000:01:00.0  On |                  N/A |
|  0%   30C    P8     1W / 160W |    433MiB /  6144MiB |      3%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2148    C+G   ...cent\WeChat\wechatweb.exe    N/A      |
|    0   N/A  N/A      2292    C+G   Insufficient Permissions        N/A      |
|    0   N/A  N/A      5184    C+G   ...w5n1h2txyewy\SearchUI.exe    N/A      |
|    0   N/A  N/A      6532    C+G   ...ekyb3d8bbwe\YourPhone.exe    N/A      |
|    0   N/A  N/A      6556    C+G   ...b3d8bbwe\WinStore.App.exe    N/A      |
|    0   N/A  N/A      6724    C+G   ...es.TextInput.InputApp.exe    N/A      |
|    0   N/A  N/A      9220    C+G   ...ekyb3d8bbwe\HxOutlook.exe    N/A      |
|    0   N/A  N/A      9596    C+G   ...lPanel\SystemSettings.exe    N/A      |
|    0   N/A  N/A      9708    C+G   ...artMenuExperienceHost.exe    N/A      |
|    0   N/A  N/A     11672    C+G   ...kyb3d8bbwe\HxAccounts.exe    N/A      |
|    0   N/A  N/A     13180    C+G   C:\Windows\explorer.exe         N/A      |
|    0   N/A  N/A     14264    C+G   ...me\Application\chrome.exe    N/A      |
|    0   N/A  N/A     14916    C+G   ...sk\BaiduNetdiskRender.exe    N/A      |
+-----------------------------------------------------------------------------+

C:\Users\PC>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:12:04_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.relgpu_drvr455TC455_06.29069683_0

Only install conda install pytorch torchvision cudatoolkit=10.1

PyCharm Community Edition 2020.3.2 x64 for selection configuration

Guess you like

Origin blog.csdn.net/u010689853/article/details/112436905