Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution in docker image issue vgg16_bn.py #57

Closed
loopedice opened this issue Oct 15, 2019 · 7 comments
Closed

Execution in docker image issue vgg16_bn.py #57

loopedice opened this issue Oct 15, 2019 · 7 comments

Comments

@loopedice
Copy link

Hey, so I got this working on my mac pretty easily. However I just can't seem to get it to work on a docker image.

It seems to crash when executing this line https://github.com/clovaai/CRAFT-pytorch/blob/master/basenet/vgg16_bn.py#L61

Tried to debug through, but don't really have any experience with pdb so got nowhere there. I suspect my Dockerfile isn't setup right. Did anyone manage to get this working or have similar issues? My dockerfile is below.

FROM ubuntu:18.04

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
 
# Install tools
RUN apt-get update \
        && apt-get --yes install \
        wget \
        curl \
        ca-certificates \
        sudo \
        git \
        bzip2 \
        libx11-6 libglib2.0-0 \
        libsm6 libxext6 libxrender-dev \
        && rm -rf /var/lib/apt/lists/*
 

 # Create a working directory
RUN mkdir /app
WORKDIR /app


# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
 && chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user

# All users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user

# Install Miniconda
RUN curl -so ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
 && chmod +x ~/miniconda.sh \
 && ~/miniconda.sh -b -p ~/miniconda \
 && rm ~/miniconda.sh
 
# Set environment PATH
ENV PATH=/home/user/miniconda/bin:$PATH
ENV CONDA_AUTO_UPDATE_CONDA=false

RUN conda install --yes python=3.6

COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .

CMD ["python", "test.py"]
@lamhoangtung
Copy link

I can confirm that this work on Docker

@loopedice
Copy link
Author

Do you mind sharing your Dockerfile setup for this?

@lamhoangtung
Copy link

@loopedice. Sure, it's extremely simple:

FROM python:3.6.8

RUN apt-get -y update
RUN apt-get install -y --fix-missing \
    wget \
    nano \
    htop \
    tmux \
    unzip \
    zip \
    && apt-get clean && rm -rf /tmp/* /var/tmp/*

COPY . /code
WORKDIR /code
RUN pip install -r requirements.txt

CMD python server.py

@loopedice
Copy link
Author

loopedice commented Oct 17, 2019

@lamhoangtung Thanks for that. It still seems to be failing. I will try again later tonight on my windows machine with docker, and see if that doesn't produce a crash like my mac.

@lamhoangtung
Copy link

@lamhoangtung Thanks for that. It still seems to be failing. I will try again later tonight on my windows machine with docker, and see if that doesn't produce a crash like my mac.

Both Mac and linux works fine for me :P

@loopedice
Copy link
Author

loopedice commented Oct 17, 2019

It's so strange 😬 Maybe my docker config has limited resources?

Edit: So with the fork here that includes @lamhoangtung Dockerfile https://github.com/loopedice/CRAFT-pytorch

it is still crashing in mac docker+ windows docker setups :(

@loopedice
Copy link
Author

loopedice commented Oct 22, 2019

Resolved my issue. Problem was that I was using torch 0.4.1 and not 0.4.1.post2. So I just went to 1.0.0 due to errors in pip not finding 0.4.1.post2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants