如何在 Windows 中安装 pytorch?

数据挖掘 火炬
2021-10-06 01:25:08

我想知道,是否有任何方法可以在 Windows 中安装 pytorch,就像我们可以安装 tensorflow 一样。我的机器不支持 docker。

2个回答

截至 2017 年 8 月 14 日,您可以从peterjc123's fork 安装 Pytorch,如下所示。目前支持 python 3.5 和 3.6。

# If your main Python version is not 3.5 or 3.6
conda create -n test python=3.6 numpy pyyaml mkl

# for CPU only packages
conda install -c peterjc123 pytorch

# for Windows 10 and Windows Server 2016, CUDA 8
conda install -c peterjc123 pytorch cuda80

# for Windows 10 and Windows Server 2016, CUDA 9
conda install -c peterjc123 pytorch cuda90

# for Windows 7/8/8.1 and Windows Server 2008/2012, CUDA 8
conda install -c peterjc123 pytorch_legacy cuda80

pytorch 对 windows链接的支持

PyTorch 应该可以在 WSL(仅限 CPU)中正常工作。