• pip install torch


    It is different from install torch with anaconda, there is a way to install torch with python.

    https://download.pytorch.org/whl/torch_stable.htmlicon-default.png?t=N7T8https://download.pytorch.org/whl/torch_stable.htmlOpen this page, then download the whl file that you need.

    For example, I choose three files named 

                    torch-1.12.0+cu116-cp39-cp39-win_amd64.whl

                    torchvision-0.13.0+cu116-cp39-cp39-win_amd64.whl

                    torchaudio-0.12.0+cu116-cp39-cp39-win_amd64.whl 

    You should pay attention to the num.

    Input the nvidia-smi you can see the version of your cuda.

    Find the right version of torch and the correct version of torchvision. There I choose cp39 because my python.version is 3.9. So you can choose 3.10 if your python.version is 3.10.

    ---------------------------------------------------

    torch         torchvision      python
    main/nightly    main/nightly    >=3.7,<=3.10
    1.13.0    0.14.0    >=3.7,<=3.10
    1.12.0    0.13.0    >=3.7, <=3.10
    1.11.0    0.12.0    >=3.7, <=3.10
    1.10.2    0.11.3    >=3.6, <=3.9
    1.10.1    0.11.2    >=3.6, <=3.9
    1.10.0    0.11.1    >=3.6, <=3.9
    1.9.1    0.10.1    >=3.6, <=3.9
    1.9.0    0.10.0    >=3.6, <=3.9
    1.8.2    0.9.2    >=3.6, <=3.9
    1.8.1    0.9.1    >=3.6, <=3.9
    1.8.0    0.9.0    >=3.6, <=3.9
    1.7.1    0.8.2    >=3.6, <=3.9
    1.7.0    0.8.1    >=3.6, <=3.8
    1.7.0    0.8.0    >=3.6, <=3.8
    1.6.0    0.7.0    >=3.6, <=3.8
    1.5.1    0.6.1    >=3.5, <=3.8
    1.5.0    0.6.0    >=3.5, <=3.8
    1.4.0    0.5.0    ==2.7, >=3.5, <=3.8
    1.3.1    0.4.2    ==2.7, >=3.5, <=3.7
    1.3.0    0.4.1    ==2.7, >=3.5, <=3.7
    1.2.0    0.4.0    ==2.7, >=3.5, <=3.7
    1.1.0    0.3.0    ==2.7, >=3.5, <=3.7
    <=1.0.1    0.2.2    ==2.7, >=3.5, <=3.7

    torch            torchaudio          python

    main / nightly main / nightly >=3.7, <=3.10

    1.12.0          0.12.0           >=3.7, <=3.10

    1.11.0          0.11.0           >=3.7, <=3.9

    1.10.0         0.10.0          >=3.6, <=3.9

    1.9.1           0.9.1           >=3.6, <=3.9

    1.9.0           0.9.0           >=3.6, <=3.9

    1.8.2           0.8.2           >=3.6, <=3.9

    1.8.1          0.8.1           >=3.6, <=3.9

    1.8.0           0.8.0          >=3.6, <=3.9

    1.7.1           0.7.2          >=3.6, <=3.9

    1.7.0           0.7.0           >=3.6, <=3.8

    1.6.0           0.6.0          >=3.6, <=3.8

    1.5.0           0.5.0          >=3.5, <=3.8

    1.4.0           0.4.0           ==2.7, >=3.5, <=3.8

    ----------------------------------------------------------------

    These are the versions you could shudy.

    You could open the cmd of your folder that you just download these files, then input your command.

    pip install torch-1.12.0+cu116-cp39-cp39-win_amd64.whl torchvision-0.13.0+cu116-cp39-cp39-win_amd64.whl torchaudio-0.12.0+cu116-cp39-cp39-win_amd64.whl

    There I just install like this:

    Test it:

    1. import torch
    2. print(torch.__version__)
    3. torch.cuda.is_available()

  • 相关阅读:
    关于重写equals方法引发的不一致
    深度解读ChatGPT基本原理
    排查服务器cpu运行过高
    Python基础-3-列表
    “熊猫视图”.Net图形控件功能介绍 [二]:一行代码实现图形图像缩放平操作
    OBS插件--音频采集
    动漫制作技术专业主要学什么?
    基本放大电路的学习
    【基础教程】Matlab实现等高线图
    tomcat (SCI)ServletContainerInitializer 的加载原理
  • 原文地址:https://blog.csdn.net/m0_72572822/article/details/132783328