Home > Net >  Docker Stuck to build Conv2D model
Docker Stuck to build Conv2D model

Time:11-23

shortcut = tensorflow.keras.layers.Conv2D(filters, 1, strides=stride, use_bias=False, kernel_initializer='glorot_normal', name=name   '_0_conv')(x)

where filters are 64 stride is 2 and name is conv2_block1

this line works perfectly fine in local machine but gets stuck in docker

Below is my docker file attached.

FROM python:3.7.9-buster


RUN apt-get update \
    && apt-get install -y -qq \ 
    && apt install cmake -y \
    && apt-get install ffmpeg libsm6 libxext6  -y\
    && apt-get clean


RUN pip3 install --upgrade pip

# Install libraries
COPY ./requirements.txt ./
RUN pip install -r requirements.txt && \
    rm ./requirements.txt

RUN pip install fire

# Setup container directories
RUN mkdir /app

# Copy local code to the container
COPY . /app


# launch server with gunicorn
WORKDIR /app
EXPOSE 8080
ENV PORT 8080

ENV FLASK_CONF config.ProductionConfig


# CMD ["gunicorn", "main:app", "--timeout=60", "--preload", \
#      "--workers=1", "--threads=4", "--bind :$PORT"]

CMD exec gunicorn --bind :$PORT main:app  --preload --workers 9 --threads 5 --timeout 120

And these are my requirements.txt

opencv-python
tensorflow==2.2.0
protobuf==3.20.*
cmake
dlib
numpy==1.16.*

CodePudding user response:

The stuck up issue was due to the exhausting resources for the thread, so removing the --preload argument did the job as the models will be executed on the runtime.

  • Related