PyTorch+CUDA용 Docker file
일반적 상황
아래에서 PyTorch 및 CUDA 버전 선택
콘다를 사용하고 싶지 않은 경우.
FROM nvidia/cuda:11.0.3-runtime-ubuntu18.04
WORKDIR /app
RUN apt-get update
RUN apt-get install -y software-properties-common tzdata
ENV TZ=Asia/Tokyo
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get -y install python3.9 python3.9-distutils python3-pip
RUN python3.9 -m pip install -U pip wheel setuptools
RUN python3.9 -m pip install torch==1.7.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html
cuda,os,pythorch의 버전을 적합한 버전으로 바꾸십시오참고물
https://codechacha.com/ja/ubuntu-install-python39/
https://stackoverflow.com/questions/68185770/installing-python3-9-and-pip-in-docker-image-and-not-python-3-8
https://sleepless-se.net/2018/07/31/docker-build-tzdata-ubuntu/
https://stackoverflow.com/questions/63823964/importerror-cannot-import-name-sysconfig-from-distutils-usr-lib-python3-8
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.9/distutils/__init__.py)
6GB 메모리
https://stackoverflow.com/questions/57291806/docker-build-failed-after-pip-installed-requirements-with-exit-code-137
/bin/sh -c pip3 install torch==1.7.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html: exit code: 137
Reference
이 문제에 관하여(PyTorch+CUDA용 Docker file), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/miyatsuki/articles/db220deeb28900텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)