GPU環境用のpythonテンプレート
イメージのビルド
bash docker.sh build
コンテナの起動
bash docker.sh shell
poetry周り
poetry install # pyproject.tomlからインストール
poetry add <パッケージ名> # パッケージをインストール
poetry remove <パッケージ名> # パッケージを削除
torchをpoetryで入れればワークディレクトリ配下の.venv/にtorchが入ってくれる
そうするとVSCodeにコンテナをアタッチしなくとも仮想環境が使える
しかし,ワークスペースごとにtorch (1.8GB)を入れる必要があるので注意
poetry add https://download.pytorch.org/whl/cu117/torch-1.13.0%2Bcu117-cp38-cp38-linux_x86_64.whl
poetry add https://download.pytorch.org/whl/cu117/torchvision-0.14.0%2Bcu117-cp38-cp38-linux_x86_64.whl
setuptools
https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/
semantic version
formatter linter周り