Is there an image that I could use to reduce size and use pytorch too?


My dockerfile

I have made this dockerfile for a pytorch application, however, i am facing this error. It works fine when i use it with image "bitnami/pytorch" or "armswdev/pytorch-arm-neoverse-n1:r21.09-torch-1.9.0-onednn-acl", but the size exceeds 4 GB in the latter and 7 GB in the former. I need to reduce it to 1.5 GB at max.

FROM python:3.8.8

RUN pip install numpy==1.21.2
RUN pip install opencv_python==
RUN pip install Pillow==8.3.2
RUN pip install torchvision
RUN pip install torch
COPY Grid-Anchor-based-Image-Cropping-Pytorch ./
RUN bash ./
RUN pip install typing-extensions==
CMD ["python", ""]


 => ERROR [5/9] RUN pip install torchvision                                                                                                                                                                         183.2s
 > [5/9] RUN pip install torchvision:
#9 0.930 Collecting torchvision
#9 1.192   Downloading torchvision-0.10.1-cp38-cp38-manylinux1_x86_64.whl (22.1 MB)
#9 5.668 Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from torchvision) (1.21.2)
#9 5.824 Collecting torch==1.9.1
#9 5.884   Downloading torch-1.9.1-cp38-cp38-manylinux1_x86_64.whl (831.4 MB)
#9 183.0 Killed
executor failed running [/bin/sh -c pip install torchvision]: exit code: 137

Source: Docker Questions

Categorised as docker, pytorch Tagged ,


Leave a Reply

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us