Editing Docker file

Hi guys i am editing Dokcer file.

Enables X11 sharing and creates user home directory

ENV USER_NAME aicrowd
ENV HOME_DIR /home/$USER_NAME

Replace HOST_UID/HOST_GUID with your user / group id (needed for X11)

ENV HOST_UID 1000
ENV HOST_GID 1000

Which of these 4 items should be changed . I have already added the necessay modules in my docker file. Help will be appreciated :slight_smile:

Hi @hannan4252,

Can you tell why are you trying to edit and/or achieve by the above edit?
By default, you shouldn’t need to edit the above lines and things should work out of the box.

Thing is i wanted to do that because i keep getting error … so i assumed that it could be because of Dockerfile and hence i wanted to edit it.

Error “Unable to orchestrate submission, please contact Administrators.” I get this error after two or three days and it does not look normal .This error was generated when i did not change USERNAME and HOST_UID but i did change the pip install thing in docker file and added keras and tensor flow so my docker file would look like. i added tensorflow and keras manually because my requirements.txt file was not being read by this Dockerfile …

FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y
build-essential
bzip2
cmake
curl
git
g++
libboost-all-dev
pkg-config
rsync
software-properties-common
sudo
tar
timidity
unzip
wget
locales
zlib1g-dev
python3-dev
python3
python3-pip
python3-tk
libjpeg-dev
libpng-dev

Python3

RUN pip3 install pip --upgrade
RUN pip3 install cython aicrowd_api timeout_decorator
numpy
matplotlib
Keras==2.1.3
tensorflow==1.13.2
scikit-image==0.16.1 \
aicrowd-repo2docker
pillow
RUN pip3 install git+https://github.com/AIcrowd/coco.git#subdirectory=PythonAPI
RUN pip3 install tensorflow-gpu

Unicode support:

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

Enables X11 sharing and creates user home directory

ENV USER_NAME aicrowd
ENV HOME_DIR /home/$USER_NAME

Replace HOST_UID/HOST_GUID with your user / group id (needed for X11)

ENV HOST_UID 1000
ENV HOST_GID 1000

RUN export uid={HOST_UID} gid={HOST_GID} &&
mkdir -p ${HOME_DIR} &&
echo “USER_NAME:x:{uid}:${gid}:$USER_NAME,:$HOME_DIR:/bin/bash” >> /etc/passwd &&
echo “USER_NAME:x:{uid}:” >> /etc/group &&
echo “$USER_NAME ALL=(ALL) NOPASSWD: ALL” > /etc/sudoers.d/$USER_NAME &&
chmod 0440 /etc/sudoers.d/USER_NAME && \ chown {uid}:{gid} -R {HOME_DIR}

USER {USER_NAME} WORKDIR {HOME_DIR}

COPY . .

RUN sudo chown {HOST_UID}:{HOST_GID} -R *
RUN sudo chmod 775 -R *

Understood. So those lines are actually fine in Dockerfile.

I debugged further to look into issue your code (#59996) is facing and this is what I found:

Traceback (most recent call last):
  File "run.py", line 332, in <module>
    run()
  [.... removed ....]
  File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1364, in __init__
    name=self.name)
  File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 504, in placeholder
    x = tf.placeholder(dtype, shape=shape, name=name)
AttributeError: module 'tensorflow' has no attribute 'placeholder'

This is happening due to wrong (?) version of tensorflow used in your submission v/s the one you may be using on your system. This can be mitigated by using tensorflow v1.4 or by disabling v2 behaviour, etc. More: https://github.com/theislab/scgen/issues/14, https://stackoverflow.com/questions/37383812/tensorflow-module-object-has-no-attribute-placeholder

When running manually the next issue I came across is, you need to add import skimage:

Traceback (most recent call last):
  File "run.py", line 332, in <module>
    run()
  File "run.py", line 304, in run
    predictions=evaluate_coco(model, image_ids=image_ids)
  File "run.py", line 220, in evaluate_coco
    image = load_image(image_id)
  File "run.py", line 162, in load_image
    image = skimage.io.imread(path)
NameError: name 'skimage' is not defined

After that your submission can start running immediately.

Running COCO evaluation on 1959 images.
0
1
2
3
4
5
6
7
8
[....] (I didn't run further)

You can fix based on above remarks and start submitting your solution.

In case you want to debug properly on your desktop directly and are comfortable with Docker, you can use aicrowd-repo2docker to generate image & execute ./run.sh (More: Which docker image is used for my submissions?).

Let us know in case we can provide any other feedback. Also, it will be good to know which starter kit/initial repository you referred for making the submission, so we can add some more debug/testing scripts to the same.

All the best with the competition! :smiley:

Regarding this, I guess the starter kit/baseline you followed didn’t respect requirements.txt (because of custom Dockerfile being used – which has highest precedence). :frowning:

We will get it fixed in whichever starter kit you used for your submission (let us know the link). Sorry for the confusion caused due to it.

Thanks alot for helping me out :slight_smile: and sorry for bothering you again but it really helped me learning a lot about dockers … Thing is with the current docker file i posted i used this docker file in #5996 and i already mentioned tensorflow_version==1.13.2 so placeholder error should not occur … right? Thanks in advance :slight_smile:

@hannan4252
I assume this line is installing tensorflow 2.0:
https://gitlab.aicrowd.com/hannan4252/food_project/blob/Submission-v3.0.6/Dockerfile#L40
RUN pip3 install tensorflow-gpu as the version number hasn’t been mentioned for this package.

Thanks alot guys its working now i hope my score is not shit after all this effort :smiley:

1 Like

Glad to know that we could help.

:crossed_fingers: for you getting good score on your first run, but all the best in improving scores over time too. Wishing you luck!

1 Like