-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall_pytorch_dependencies.py
24 lines (15 loc) · 1.04 KB
/
install_pytorch_dependencies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import sys
import subprocess
def install_pytorch_modules(target):
environ_copy = dict(os.environ)
environ_copy["PYTHONNOUSERSITE"] = "1"
subprocess.run([sys.executable, "-m", "pip", "install", "torch", "torchvision", "--extra-index-url", "https://download.pytorch.org/whl/cu116", "--no-cache-dir", "--target", target], check=True, env=environ_copy)
def install_pytorch_amd_modules(target):
environ_copy = dict(os.environ)
environ_copy["PYTHONNOUSERSITE"] = "1"
subprocess.run([sys.executable, "-m", "pip", "install", "torch", "torchvision", "--extra-index-url", "https://download.pytorch.org/whl/rocm5.2/", "--no-cache-dir", "--target", target], check=True, env=environ_copy)
def install_pytorch_apple_modules(target):
environ_copy = dict(os.environ)
environ_copy["PYTHONNOUSERSITE"] = "1"
subprocess.run([sys.executable, "-m", "pip", "install", "torch", "torchvision", "--extra-index-url", "https://download.pytorch.org/whl/nightly/cpu", "--no-cache-dir", "--target", target], check=True, env=environ_copy)