{"id":13435235,"url":"https://github.com/peterjc123/pytorch-scripts","last_synced_at":"2025-03-18T02:31:21.210Z","repository":{"id":139807731,"uuid":"112206309","full_name":"peterjc123/pytorch-scripts","owner":"peterjc123","description":"A few Windows specific scripts for PyTorch","archived":true,"fork":false,"pushed_at":"2024-09-13T13:47:12.000Z","size":97,"stargazers_count":414,"open_issues_count":5,"forks_count":57,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-10-27T17:25:54.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterjc123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://afdian.net/@peterjc123"]}},"created_at":"2017-11-27T14:27:52.000Z","updated_at":"2024-09-20T18:54:13.000Z","dependencies_parsed_at":"2024-10-27T17:13:20.196Z","dependency_job_id":"bb2e07f5-69b3-4e2e-9d01-05d09b5c1621","html_url":"https://github.com/peterjc123/pytorch-scripts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterjc123%2Fpytorch-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterjc123%2Fpytorch-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterjc123%2Fpytorch-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterjc123%2Fpytorch-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterjc123","download_url":"https://codeload.github.com/peterjc123/pytorch-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244143999,"owners_count":20405314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:00:34.096Z","updated_at":"2025-03-18T02:31:21.204Z","avatar_url":"https://github.com/peterjc123.png","language":"Batchfile","readme":"# Update\nThis repo **won't** be updated anymore. Please refer to https://github.com/pytorch/builder/tree/main/windows for PyTorch building scripts and https://pytorch.org for PyTorch installation.\n\n# Original Content\n\nIt is a repo that contains scripts that makes using PyTorch on Windows easier.\n\n# Easy Installation\n**Update: Starting from 0.4.0, you can go to the [official site](http://pytorch.org) for installation steps. The packages here will not be updated.**\nIf you just want to install PyTorch as soon as possible, you can try this one out.\nThe current version of the conda package for PyTorch is 0.3.1.\nYou'll need Anaconda first. And then type in the following commands.\n```Powershell\n# If your main Python version is not 3.5 or 3.6\nconda create -n test python=3.6 numpy pyyaml mkl\n\n# for CPU only packages\nconda install -c peterjc123 pytorch-cpu\n\n# for Windows 10 and Windows Server 2016, CUDA 8\nconda install -c peterjc123 pytorch\n\n# for Windows 10 and Windows Server 2016, CUDA 9\nconda install -c peterjc123 pytorch cuda90\n\n# for Windows 7/8/8.1 and Windows Server 2008/2012, CUDA 8\nconda install -c peterjc123 pytorch_legacy\n```\nPlus: The support for old NV cards (Compute Capability \u003c= 5.0) is over. \nThere're mainly two ways to resolve this:\n1. You can install legacy packages. See description in this section below.\n2. Install CI packages. However, you have to handle the dependencies by yourself. See __About CI packages__ for details.\n\nIf there's conflict against vc14, you may see workground [here](https://github.com/peterjc123/pytorch-scripts/issues/3).\nSometimes the new packages may not work, when that happens, you may try the legacy packages [here](https://drive.google.com/drive/folders/0B-X0-FlSGfCYdTNldW02UGl4MXM?usp=sharing). If you are from China, then the files are stored in Baidu Netdisk. You can access them through this [link](https://pan.baidu.com/s/1dF6ayLr).\n\n# About CI packages\n\nThere may be chances that the conda package is stale and you want to try out new features. For this purpose, the CI packages are generated. \n\n| System                   | All                                      |\n| ------------------------ | ---------------------------------------- |\n| Windows CPU (master)     | [![Build status](https://ci.appveyor.com/api/projects/status/8xiih9d2w4pwnq4k/branch/windows-full?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch/branch/windows-full) |\n| Windows GPU (master)     | [![Build status](https://ci.appveyor.com/api/projects/status/y6geguaq83igjh58/branch/windows-full?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch-elheu/branch/windows-full) |\n| Windows CPU (0.4.0)      | [![Build status](https://ci.appveyor.com/api/projects/status/8xiih9d2w4pwnq4k/branch/v0.4.0?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch/branch/v0.4.0) |\n| Windows GPU (0.4.0)      | [![Build status](https://ci.appveyor.com/api/projects/status/y6geguaq83igjh58/branch/v0.4.0?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch-elheu/branch/v0.4.0) |\n| Windows CPU (0.4.1)      | [![Build status](https://ci.appveyor.com/api/projects/status/8xiih9d2w4pwnq4k/branch/v0.4.1?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch/branch/v0.4.1) |\n| Windows GPU (0.4.1)      | [![Build status](https://ci.appveyor.com/api/projects/status/y6geguaq83igjh58/branch/v0.4.1?svg=true)](https://ci.appveyor.com/project/peterjc123/pytorch-elheu/branch/v0.4.1) |\n\n# About the nightly packages\n\nAn additional CI is setup to run every night so that you can also get the latest packages. The installation steps can be seen [here](https://github.com/pytorch/pytorch/issues/13227#issuecomment-445140508).\n\n| Configuration / Python version | 3.5                                                          | 3.6                                                          | 3.7                                                          |\n| ------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| Windows x64 CPU (Conda)        | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Conda_Build\u0026configuration=Windows_CPU_Conda_Build%20PY3.5) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Conda_Build\u0026configuration=Windows_CPU_Conda_Build%20PY3.6) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Conda_Build\u0026configuration=Windows_CPU_Conda_Build%20PY3.7) |\n| Windows x64 CPU (Wheels)       | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Wheels_Build\u0026configuration=Windows_CPU_Wheels_Build%20PY3.5) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Wheels_Build\u0026configuration=Windows_CPU_Wheels_Build%20PY3.6) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Wheels_Build\u0026configuration=Windows_CPU_Wheels_Build%20PY3.7) |\n| Windows x64 CUDA 9.2 (Conda)   | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.5_92) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.6_92) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.7_92) |\n| Windows x64 CUDA 9.2 (Wheels)  | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.5_92) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.6_92) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.7_92) |\n| Windows x64 CUDA 10.0 (Conda)   | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.5_100) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.6_100) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Conda_Build\u0026configuration=Windows_CUDA_Conda_Build%20PY3.7_100) |\n| Windows x64 CUDA 10.0 (Wheels)  | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.5_100) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.6_100) | ![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20PY3.7_100) |\n\nAnd here are the libtorch packages. Only shared build is supported now. Please click the badge to download the latest package for a specific configuration.\n\n| Configuration / LibTorch version | Shared library                                               |\n| -------------------------------- | ------------------------------------------------------------ |\n| Windows x64 CPU (Release)        | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Wheels_Build\u0026configuration=Windows_CPU_Wheels_Build%20LIBTORCH)](https://download.pytorch.org/libtorch/nightly/cpu/libtorch-win-shared-with-deps-latest.zip) |\n| Windows x64 CPU (Debug)          | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CPU_Wheels_Build\u0026configuration=Windows_CPU_Wheels_Build%20LIBTORCH_DEBUG)](https://download.pytorch.org/libtorch/nightly/cpu/libtorch-win-shared-with-deps-debug-latest.zip) |\n| Windows x64 CUDA 9.2 (Release)   | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20LIBTORCH_92)](https://download.pytorch.org/libtorch/nightly/cu92/libtorch-win-shared-with-deps-latest.zip) |\n| Windows x64 CUDA 9.2 (Debug)     | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20LIBTORCH_92_DEBUG)](https://download.pytorch.org/libtorch/nightly/cu92/libtorch-win-shared-with-deps-debug-latest.zip) |\n| Windows x64 CUDA 10.0 (Release)  | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20LIBTORCH_100)](https://download.pytorch.org/libtorch/nightly/cu100/libtorch-win-shared-with-deps-latest.zip) |\n| Windows x64 CUDA 10.0 (Debug)  | [![Build status](https://dev.azure.com/pytorch/PyTorch/_apis/build/status/peterjc123.builder?branchName=master\u0026jobName=Windows_CUDA_Wheels_Build\u0026configuration=Windows_CUDA_Wheels_Build%20LIBTORCH_100_DEBUG)](https://download.pytorch.org/libtorch/nightly/cu100/libtorch-win-shared-with-deps-debug-latest.zip) |\n\n## How to find the package and install?\n\nYou can first click the icon to get to the main page of the CI system for a certain package. You can see a few jobs under that page. There're several variables that is used to distinguish the packages.\n\n\n- **PYTHON_VERSION** : This one indicates the python version it use. \n\n\n- **TORCH\\_CUDA\\_ARCH\\_LIST** : It implies the architecture of the GPU, only **Pascal**, **Maxwell** and **Kepler** is supported.\n\nAfter the choice of the jobs, you can see the generated package if you click on **Artifact** on the navigation bar in the middle of the page.\n\nInstallation is simple, but there're some requirements.\n\n```powershell\n# For all versions\n# Windows x64\n# Python x64 3.5 / 3.6\n# MKL/Numpy/PyYAML\n\n# For GPU versions\n# CUDA 9 / 9.1\n# cuDNN 7\n# NVTX (Visual Studio Integration in CUDA. if it fails to be installed, you can extract\n#       the CUDA installer exe and found the NVTX installer under the CUDAVisualStudioIntegration)\n\npip install numpy mkl intel-openmp\npip install pytorch-[version]-cp[pyversion]-cp[pyversion]m-win-amd64.whl\n# Add [PythonRoot]\\Library\\bin into environment variable `PATH` and restart command prompt before using.\n```\n\nNote: You may face with the following issue. First, check that all the dependencies are installed. Second, try if a fresh virtual environment helps. If it helps, it may be an issue of the python version. And you can install VC 2017 Redist. Finally, you may have to manually compile PyTorch from source.\n\n```pytb\nC:\\Anaconda2\\lib\\site-packages\\torch\\__init__.pyc in \u003cmodule\u003e()\n     39     os.environ['PATH'] = os.path.dirname(__file__) + '\\\\lib\\\\;' + os.environ['PATH']\n     40\n---\u003e 41     from torch._C import *\n     42     __all__ += [name for name in dir(_C)\n     43                 if name[0] != '_' and\n\nImportError: DLL load failed: The specified procedure could not be found.\n```\n\n# Compiling Examples\nYou can download it and put it in the PyTorch directory or use it in a standalone way.\nThere're more details about MSVC 2017 setup in [#23](https://github.com/peterjc123/pytorch-scripts/issues/23).\n```Powershell\n################################################################################\n# These are the flags that you can set before running the scripts.\n################################################################################\n\n# You can specify which version you want to build\n# If you omit it, it will build for the master branch on default\nset PYTORCH_BUILD_VERSION=0.4.1\n\n# If you want to build your own fork of PyTorch\nset PYTORCH_REPO=pytorch\n\n# If you want to build for a specific branch\n# Note: If you specify PYTORCH_BUILD_VERSION too, it won't be used.\nset PYTORCH_BRANCH=master\n\n# If you want to skip the confirmation of the flags configured by our script\nset NO_PROMPT=1\n\n# If you want to continue build without a verified VS version (Safe for CPU builds)\nset SKIP_VS_VER_CHECK=1\n\n# If you want to skip prompt for building for Python 2.7 (Not recommended)\nset SKIP_PY_VER_CHECK=1\n\n# If you want to build for LibTorch\nset BUILD_PYTHONLESS=1\n\n################################################################################\n# These are the available scripts that you can use.\n################################################################################\n\n# If you don't want to override the default settings\nauto.bat\n\n# If you don't want to compile with CUDA\ncpu.bat\n\n# If you want to compile with CUDA 8\ncuda80.bat\n\n# If you want to compile with CUDA 9\ncuda90.bat\n\n# If you want to compile with CUDA 9.1\ncuda91.bat\n\n# If you want to compile with CUDA 9.2\ncuda92.bat\n\n# If you want to compile with CUDA 10.0\ncuda100.bat\n\n```\n\n# Using Examples\n```Python\n# The main difference in Python between Windows and Unix systems is multiprocessing\n# So please refactor your code into the following structure if you use DataLoader\n\nimport torch\n\ndef main():\n    for i, (x, y) in dataloader:\n        # do something here\n\nif __name__ == '__main__':\n    main()\n```\n","funding_links":["https://afdian.net/@peterjc123"],"categories":["Batchfile","Pytorch elsewhere ｜ Pytorch相关","Pytorch elsewhere"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterjc123%2Fpytorch-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterjc123%2Fpytorch-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterjc123%2Fpytorch-scripts/lists"}