advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
8.14k stars 864 forks source link

docker: `ERROR: failed to solve: nvidia/cuda:10.2-runtime-ubuntu18.04` #263

Closed osalbahr closed 1 year ago

osalbahr commented 1 year ago

How can I deploy this model in a container?

I was trying to use the "3. Docker: No actions are needed 🎉" method and I am not sure how to get to that state. I assumed it is by using the ./docker/build.sh. However, it seems that it is using an old version of nvidia/cuda (probably kept for reproducibility purposes):

[USER:HOST] lama$ ./docker/build.sh 
[+] Building 0.4s (3/3) FINISHED                                 docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.61kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => ERROR [internal] load metadata for docker.io/nvidia/cuda:10.2-runtime  0.3s
------
 > [internal] load metadata for docker.io/nvidia/cuda:10.2-runtime-ubuntu18.04:
------
Dockerfile:1
--------------------
   1 | >>> FROM nvidia/cuda:10.2-runtime-ubuntu18.04
   2 |     
   3 |     RUN apt-get update && \
--------------------
ERROR: failed to solve: nvidia/cuda:10.2-runtime-ubuntu18.04: docker.io/nvidia/cuda:10.2-runtime-ubuntu18.04: not found
amangupta2303 commented 1 year ago

@osalbahr I'm getting the same error. Did you find any solution?

osalbahr commented 1 year ago

@osalbahr I'm getting the same error. Did you find any solution?

I haven’t. It looks like Nvidia/cuda discontinued ubuntu 18 support https://hub.docker.com/r/nvidia/cuda

amangupta2303 commented 1 year ago

@osalbahr I got the solution! Providing you the working dockerfile for LAMA model. It works on the latest pytorch and cuda versions. I hope it helps!!

FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1

RUN apt-get update && \ apt-get install -y libgl1-mesa-glx && \ rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y libglib2.0-0

RUN python -m pip install --upgrade pip && \ pip install -U pip numpy scipy torchvision tensorflow joblib matplotlib pandas \ pytorch-lightning==1.2.9 tabulate easydict==1.10 kornia==0.5.0 webdataset \ packaging gpustat tqdm pyyaml hydra-core==1.1.0.dev6 scikit-learn==1.3.1 tabulate && \ pip install scikit-image==0.22.0 torchtext==0.6.0 albumentations==0.5.2 opencv-python==4.8.1.78

RUN useradd -ms /bin/bash admin

WORKDIR /workspace

RUN chown -R admin:admin /workspace && \ chmod 777 /workspace

USER admin

senya-ashukha commented 1 year ago

TY @amangupta2303 !