How to install pytorch in windows?

前端 未结 16 1963
时光取名叫无心
时光取名叫无心 2020-12-05 19:52

I am trying to install pytorch on windows and there is one which is available for it but shows an error.

conda install -c peterjc123 pytorch=0.1.12


        
相关标签:
16条回答
  • 2020-12-05 20:09

    Below is the working configuration:

    Python 3.8

    Pytorch version 1.5.1

    Windows 10

    pytorch installation command:

    conda install pytorch torchvision cudatoolkit=9.2 -c pytorch -c defaults -c numba/label/dev
    
    0 讨论(0)
  • 2020-12-05 20:12

    Update June 2019: pytorch has a dedicated conda channel now and can be installed easily with anaconda. The command generated at pytorch will require dependencies before it can be executed successfully. For example I chose stable pytorch 1.1 build with python 3.6 and Cuda 10.0. The command generated by pytorch page was as follows:

    conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

    But it will not work if you have created a new conda environment like me. The step by step process for setting up pytorch is as follows:

    • First install the cudatoolkit as follows:

    conda install -c anaconda cudatoolkit=10.0

    • Then install the mkl_fft as follows:

    conda install -c anaconda mkl_fft

    • Assuming you will face no more dependency issues. Use the following command to setup pytorch:

    conda install -c pytorch pytorch

    This worked for me. But I had setup my new conda environment with scikit-learn and jupyter notebook before starting the pytorch setup. So if any dependency problem arise, it would be a good idea to install both scikit-learn and jupyter notebook as well.

    0 讨论(0)
  • 2020-12-05 20:12

    Try running:

    conda install -c pytorch pytorch
    

    The command will update/install: conda, cudatoolkit, pytorch.

    0 讨论(0)
  • 2020-12-05 20:20

    Try this

    1. cd C:\Program files\Anaconda3\condabin
    2. conda install pytorch-cpu torchvision-cpu -c pytorch

    https://pytorch.org/get-started/locally/#anaconda

    0 讨论(0)
  • You may want to consider using Docker for Windows. This would enable you to install pytorch as you would on Linux. Although, I believe that DfW has limited CUDA support, so you may want to explore a different option if you plan on using CUDA.

    0 讨论(0)
  • 2020-12-05 20:23

    The trick is to go to the PyTorch website and select the things you need:

    0 讨论(0)
提交回复
热议问题