Sign inSign up

ariqbasyar/pytorch

By ariqbasyar

•Updated almost 3 years ago

Minimal PyTorch using nvcr.io/nvidia/l4t-pytorch:r32.6.1-pth1.9-py3 with more utils like OpenCV etc.

Image
2

1.1K

ariqbasyar/pytorch repository overview

https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch⁠

⁠Build with CUDA

  • The Dockerfile file:
ARG IMAGE=nvcr.io/nvidia/l4t-pytorch:r32.6.1-pth1.9-py3
FROM $IMAGE as build

RUN apt-get update \
    && rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip \
    opencv-python

RUN pip3 install pandas \
    matplotlib \
    PyYAML \
    requests \
    scipy \
    tqdm \
    tensorboard \
    seaborn

RUN pip3 install scikit-learn

FROM $IMAGE

RUN apt-get update \
    && rm -rf /var/lib/apt/lists/*

RUN update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

COPY --from=build /usr/local/lib/python3.6/dist-packages /usr/local/lib/python3.6/dist-packages
  • Build the image using docker buildx:
docker buildx build \
    --platform linux/arm64 \
    -t ariqbasyar/pytorch:$TAG\
    --push .

⁠Build with CPU

  • The Dockerfile file:
ARG PYTHON_VER=3.7.12
ARG PYTORCH_VER=v1.9.0

FROM python:${PYTHON_VER}-slim-buster as build

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        ca-certificates \
        ccache \
        cmake \
        curl \
        git \
        libjpeg-dev \
        libpng-dev && \
    rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip \
    pyyaml typing-extensions

RUN --mount=type=cache,target=/tmp/git_cache/ \
    git clone https://github.com/pytorch/pytorch.git \
        && cd pytorch \
        && git checkout $PYTORCH_VER \
        && git submodule update --init --recursive

WORKDIR pytorch
RUN USE_NUMPY=1 python setup.py install
RUN pip install torchvision



FROM python:${PYTHON_VER}-slim-buster

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        ca-certificates \
        ccache \
        cmake \
        curl \
        git \
        libjpeg-dev \
        libpng-dev && \
    rm -rf /var/lib/apt/lists/*

COPY --from=build /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
  • Build the image using docker buildx:
docker buildx build \
    --platform linux/amd64,linux/arm64 \
    -t ariqbasyar/pytorch:$TAG \
    --push .

Tag summary

Content type

Image

Digest

sha256:e7a2708a0…

Size

3.4 GB

Last updated

almost 3 years ago

docker pull ariqbasyar/pytorch:v2.1.1-py3.9.18-yolov7