Spaces:
Runtime error
Runtime error
update dockerfile
Browse files- Dockerfile +2 -10
Dockerfile
CHANGED
@@ -13,11 +13,10 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
13 |
COPY --chown=user . /app
|
14 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
15 |
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04
|
16 |
-
# use an older system (18.04) to avoid opencv incompatibility (issue#3524)
|
17 |
|
18 |
ENV DEBIAN_FRONTEND noninteractive
|
19 |
RUN apt-get update && apt-get install -y \
|
20 |
-
python3-opencv ca-certificates python3-dev git wget sudo ninja-build
|
21 |
RUN ln -sv /usr/bin/python3 /usr/bin/python
|
22 |
|
23 |
# create a non-root user
|
@@ -34,22 +33,15 @@ RUN wget https://bootstrap.pypa.io/pip/3.6/get-pip.py && \
|
|
34 |
|
35 |
# install dependencies
|
36 |
# See https://pytorch.org/ for other options if you use a different version of CUDA
|
37 |
-
RUN pip install --user tensorboard cmake onnx
|
38 |
-
RUN pip install --user torch==1.10 torchvision==0.11.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html
|
39 |
|
40 |
RUN pip install --user 'git+https://github.com/facebookresearch/fvcore'
|
41 |
-
# install detectron2
|
42 |
RUN git clone https://github.com/facebookresearch/detectron2 detectron2_repo
|
43 |
-
# set FORCE_CUDA because during `docker build` cuda is not accessible
|
44 |
ENV FORCE_CUDA="1"
|
45 |
-
# This will by default build detectron2 for all common cuda architectures and take a lot more time,
|
46 |
-
# because inside `docker build`, there is no way to tell which architecture will be used.
|
47 |
ARG TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
|
48 |
ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"
|
49 |
|
50 |
RUN pip install --user -e detectron2_repo
|
51 |
-
|
52 |
-
# Set a fixed model cache directory.
|
53 |
ENV FVCORE_CACHE="/tmp"
|
54 |
WORKDIR /home/user/detectron2_repo
|
55 |
|
|
|
13 |
COPY --chown=user . /app
|
14 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
15 |
FROM nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04
|
|
|
16 |
|
17 |
ENV DEBIAN_FRONTEND noninteractive
|
18 |
RUN apt-get update && apt-get install -y \
|
19 |
+
python3-opencv ca-certificates python3-dev git wget sudo ninja-build
|
20 |
RUN ln -sv /usr/bin/python3 /usr/bin/python
|
21 |
|
22 |
# create a non-root user
|
|
|
33 |
|
34 |
# install dependencies
|
35 |
# See https://pytorch.org/ for other options if you use a different version of CUDA
|
36 |
+
RUN pip install --user tensorboard cmake onnx
|
|
|
37 |
|
38 |
RUN pip install --user 'git+https://github.com/facebookresearch/fvcore'
|
|
|
39 |
RUN git clone https://github.com/facebookresearch/detectron2 detectron2_repo
|
|
|
40 |
ENV FORCE_CUDA="1"
|
|
|
|
|
41 |
ARG TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
|
42 |
ENV TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST}"
|
43 |
|
44 |
RUN pip install --user -e detectron2_repo
|
|
|
|
|
45 |
ENV FVCORE_CACHE="/tmp"
|
46 |
WORKDIR /home/user/detectron2_repo
|
47 |
|