Skip to content

Docker image build error when installing pytorch #3

@msjun23

Description

@msjun23

Docker container image that used this project install latest Miniconda3 for using python, and python version of latest Miniconda3 is python3.10(for now, 11th Jan, 2023).

And pytorch version, to be installed when building image, is 1.9.0 that is matched with CUDA version 11.1.1. Torchvision is also dependent with cu111. Now problem is that, pytorch doesn't support torch1.9.0+cu111 for python version 3.10, same as torchvision.

So Docker image file have to be fixed to install specific version of python, Miniconda3.

18, 20, 21 lines have to be fixed.

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN mkdir /root/.conda
RUN bash Miniconda3-latest-Linux-x86_64.sh -b
RUN rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda init bash

to

RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-x86_64.sh
RUN mkdir /root/.conda
RUN bash Miniconda3-py39_22.11.1-1-Linux-x86_64.sh -b
RUN rm -f Miniconda3-py39_22.11.1-1-Linux-x86_64.sh
RUN conda init bash

In this example, we download Miniconda3 for python 3.9, and python 3.9 support pytorch version 1.9.0+cu111.

If you want to use another specific version of python or Miniconda3, recommend you to visit the Miniconda3 Download pages. At here, just find the specific version, you want to use, and fix the lines above in Docker file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions