use feature to install pytorch

This commit is contained in:
Stephan Auerhahn
2023-08-12 05:59:57 +00:00
parent ab11af1431
commit 3167b358c0
3 changed files with 58 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
{
"name": "Python 3",
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/hatch:2": {
@@ -13,6 +13,10 @@
},
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": "libgl1-mesa-glx"
},
"ghcr.io/stability-ai/devcontainer-features/pytorch:1.0.1": {
"version": "2.0.1",
"cudaVersion": "cpu"
}
},
"customizations": {
@@ -23,11 +27,19 @@
"ms-python.black-formatter"
],
"settings": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.wordBasedSuggestions": false
},
"python.analysis.typeCheckingMode": "basic",
"black-formatter.args": [
"-l 88"
]
}
}
},
"postCreateCommand": "git config --global --add safe.directory '*'; pip install -r requirements/pt2.txt; pip install -e ."
}
},
"postCreateCommand": "git config --global --add safe.directory '*'",
"postAttachCommand": "pip install -U -r requirements/pt2.txt;pip install -U -e ."
}

View File

@@ -1,8 +1,8 @@
{
"name": "Python 3",
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.8-bullseye",
"features": {
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
"cudaVersion": "11.7"
},
"ghcr.io/devcontainers-contrib/features/hatch:2": {
@@ -16,6 +16,10 @@
},
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": "libgl1-mesa-glx"
},
"ghcr.io/stability-ai/devcontainer-features/pytorch:1.0.1": {
"version": "1.13.1",
"cudaVersion": "cu117"
}
},
"customizations": {
@@ -26,11 +30,23 @@
"ms-python.black-formatter"
],
"settings": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.wordBasedSuggestions": false
},
"python.analysis.typeCheckingMode": "basic",
"black-formatter.args": [
"-l 88"
]
}
}
},
"runArgs": ["--gpus", "all"],
"postCreateCommand": "git config --global --add safe.directory '*'; pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117; pip install -r requirements/pt13.txt; pip install -e ."
}
"runArgs": [
"--gpus",
"all"
],
"postCreateCommand": "git config --global --add safe.directory '*'",
"postAttachCommand": "pip install -U -r requirements/pt13.txt;pip install -U -e ."
}

View File

@@ -16,6 +16,10 @@
},
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"packages": "libgl1-mesa-glx"
},
"ghcr.io/stability-ai/devcontainer-features/pytorch:1.0.1": {
"version": "2.0.1",
"cudaVersion": "cu118"
}
},
"customizations": {
@@ -26,8 +30,16 @@
"ms-python.black-formatter"
],
"settings": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.wordBasedSuggestions": false
},
"python.analysis.typeCheckingMode": "basic",
"black-formatter.args": [
"-l 88"
]
}
}
},
@@ -35,5 +47,6 @@
"--gpus",
"all"
],
"postCreateCommand": "git config --global --add safe.directory '*'; pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 --index-url https://download.pytorch.org/whl/cu118;pip install -r requirements/pt2.txt;pip install -e ."
"postCreateCommand": "git config --global --add safe.directory '*'",
"postAttachCommand": "pip install -U -r requirements/pt2.txt;pip install -U -e ."
}