lolout1 commited on
Commit
2100d80
·
1 Parent(s): 218b189

added changes to gradio_test.py for gradio dependency issues

Browse files
Files changed (1) hide show
  1. Dockerfile +61 -32
Dockerfile CHANGED
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
22
  libgl1-mesa-glx \
23
  libglib2.0-0 \
24
  libgomp1 \
 
25
  && rm -rf /var/lib/apt/lists/*
26
 
27
  # Set python3.9 as default
@@ -35,49 +36,77 @@ RUN python -m pip install --upgrade pip==23.0.1 setuptools==65.5.0 wheel
35
  RUN useradd -m -u 1000 user
36
  WORKDIR /app
37
 
38
- # Install PyTorch CPU
39
- RUN pip install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
40
 
41
- # Install core dependencies with compatible versions
42
  RUN pip install \
43
- numpy==1.21.6 \
44
- Pillow==9.3.0 \
45
- opencv-python==4.7.0.72 \
46
- cython==0.29.35
47
 
48
- # Install detectron2 CPU
49
- RUN pip install detectron2==0.6 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.13/index.html
50
 
51
- # Install compatible versions - Fixed for httpx/gradio compatibility
52
  RUN pip install \
53
- gradio==3.50.2 \
54
- httpx==0.24.1 \
55
- httpcore==0.17.3 \
56
- huggingface_hub==0.16.4 \
57
- scipy==1.9.3 \
58
- scikit-image==0.19.3 \
59
- scikit-learn==1.2.2 \
60
- timm==0.6.13 \
61
- einops==0.6.1 \
62
- tqdm==4.65.0 \
 
 
 
 
 
 
 
63
  imutils==0.5.4 \
64
- shapely==2.0.1 \
65
- h5py==3.8.0 \
66
- regex==2023.3.23 \
67
- ftfy==6.1.1 \
68
- inflect==6.0.4 \
69
- gdown==4.7.1 \
70
- wget==3.2
 
 
 
71
 
72
  # Optional dependencies
73
- RUN pip install submitit==1.4.5 || echo "submitit failed"
74
- RUN pip install pytorch_lightning==1.9.5 || echo "pytorch_lightning failed"
75
- RUN pip install wandb==0.15.0 || echo "wandb failed"
 
76
 
77
- # Try NATTEN
78
- RUN pip install natten==0.14.6 -f https://shi-labs.com/natten/wheels/cpu/torch1.13/index.html || \
79
  echo "NATTEN installation failed"
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  # Switch to user
82
  USER user
83
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
 
22
  libgl1-mesa-glx \
23
  libglib2.0-0 \
24
  libgomp1 \
25
+ ninja-build \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
  # Set python3.9 as default
 
36
  RUN useradd -m -u 1000 user
37
  WORKDIR /app
38
 
39
+ # Install PyTorch 1.9 CPU - FIXED VERSION
40
+ RUN pip install torch==1.9.0+cpu torchvision==0.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
41
 
42
+ # Install core dependencies compatible with torch 1.9
43
  RUN pip install \
44
+ numpy==1.19.5 \
45
+ Pillow==8.3.2 \
46
+ opencv-python==4.5.3.56 \
47
+ cython==0.29.24
48
 
49
+ # Install detectron2 for PyTorch 1.9 CPU - CORRECT URL
50
+ RUN python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
51
 
52
+ # Install Gradio with compatible dependencies
53
  RUN pip install \
54
+ gradio==3.1.7 \
55
+ httpx==0.23.0 \
56
+ httpcore==0.15.0 \
57
+ anyio==3.6.1 \
58
+ starlette==0.19.1 \
59
+ fastapi==0.78.0 \
60
+ uvicorn==0.18.2
61
+
62
+ # Install other dependencies
63
+ RUN pip install \
64
+ huggingface_hub==0.8.1 \
65
+ scipy==1.7.1 \
66
+ scikit-image==0.18.3 \
67
+ scikit-learn==1.0.2 \
68
+ timm==0.4.12 \
69
+ einops==0.3.2 \
70
+ tqdm==4.62.3 \
71
  imutils==0.5.4 \
72
+ shapely==1.8.0 \
73
+ h5py==3.1.0 \
74
+ regex==2021.11.10 \
75
+ ftfy==6.0.3 \
76
+ inflect==5.3.0 \
77
+ gdown==4.2.0 \
78
+ wget==3.2 \
79
+ PyYAML==5.4.1 \
80
+ pycocotools==2.0.4 \
81
+ matplotlib==3.5.1
82
 
83
  # Optional dependencies
84
+ RUN pip install submitit==1.4.1 || echo "submitit failed"
85
+ RUN pip install pytorch_lightning==1.5.10 || echo "pytorch_lightning failed"
86
+ RUN pip install wandb==0.12.9 || echo "wandb failed"
87
+ RUN pip install icecream==2.1.1 || echo "icecream failed"
88
 
89
+ # Try NATTEN for torch 1.9
90
+ RUN pip install natten==0.14.6 -f https://shi-labs.com/natten/wheels/cpu/torch1.9/index.html || \
91
  echo "NATTEN installation failed"
92
 
93
+ # OneFormer specific dependencies
94
+ RUN pip install \
95
+ omegaconf==2.1.1 \
96
+ hydra-core==1.1.1 \
97
+ termcolor==1.1.0 \
98
+ tabulate==0.8.9 \
99
+ yacs==0.1.8 \
100
+ cloudpickle==2.0.0 \
101
+ packaging==21.3
102
+
103
+ # Install additional tools
104
+ RUN pip install \
105
+ iopath==0.1.9 \
106
+ fvcore==0.1.5.post20220512 \
107
+ pydot==1.4.2 \
108
+ portalocker==2.5.1
109
+
110
  # Switch to user
111
  USER user
112
  ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH