saniaE commited on
Commit
c46b088
·
1 Parent(s): b5708b6

testing docker fix

Browse files
Files changed (3) hide show
  1. Dockerfile +3 -2
  2. app.py +3 -0
  3. requirements.txt +1 -1
Dockerfile CHANGED
@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \
11
  git \
12
  wget \
13
  && rm -rf /var/lib/apt/lists/*
14
-
15
  # Set up a new user
16
  RUN useradd -m -u 1000 user
17
  USER user
@@ -29,7 +29,8 @@ RUN pip install --no-cache-dir -r requirements.txt
29
  RUN git clone --depth 1 https://github.com/tensorflow/models.git
30
  WORKDIR $HOME/app/models/research
31
  RUN protoc object_detection/protos/*.proto --python_out=.
32
- RUN cp object_detection/packages/tf2/setup.py . && pip install .
 
33
 
34
  WORKDIR $HOME/app
35
 
 
11
  git \
12
  wget \
13
  && rm -rf /var/lib/apt/lists/*
14
+
15
  # Set up a new user
16
  RUN useradd -m -u 1000 user
17
  USER user
 
29
  RUN git clone --depth 1 https://github.com/tensorflow/models.git
30
  WORKDIR $HOME/app/models/research
31
  RUN protoc object_detection/protos/*.proto --python_out=.
32
+ RUN cp object_detection/packages/tf2/setup.py . && \
33
+ python -m pip install --use-deprecated=legacy-resolver .
34
 
35
  WORKDIR $HOME/app
36
 
app.py CHANGED
@@ -2,6 +2,9 @@ import os
2
  import io
3
  import cv2
4
  import numpy as np
 
 
 
5
  import tensorflow as tf
6
  from fastapi import FastAPI, UploadFile, File
7
  from PIL import Image
 
2
  import io
3
  import cv2
4
  import numpy as np
5
+ import os
6
+ os.environ['TF_USE_LEGACY_KERAS'] = '1'
7
+ import tf_keras as keras
8
  import tensorflow as tf
9
  from fastapi import FastAPI, UploadFile, File
10
  from PIL import Image
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  tensorflow==2.13.0
2
- tf-keras==2.15.0
3
  keras==2.13.1
4
  numpy==1.24.3
5
  pandas==2.0.3
 
1
  tensorflow==2.13.0
2
+ tf-keras==2.13.0
3
  keras==2.13.1
4
  numpy==1.24.3
5
  pandas==2.0.3