Need help to run docker locally on Ubuntu system

Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 18, 2022, 12:23 a.m.

Dear Organisers,

I downloaded the Category 1 github and followed the steps to run it without making any modifications to see if it will run. I am getting the following error:

(base) bilal@my-PC:~/mlworks/surgtoolloc2022-category-1$ sudo bash test.sh Sending build context to Docker daemon 6.892MB Step 1/13 : FROM pytorch/pytorch ---> eb86f059e26c Step 2/13 : RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm ---> Using cache ---> 75c457f74dcf Step 3/13 : RUN mkdir -p /opt/algorithm /input /output && chown algorithm:algorithm /opt/algorithm /input /output ---> Using cache ---> 7eab83656e4c Step 4/13 : RUN apt-get update ---> Using cache ---> 1054f9e6c6a6 Step 5/13 : RUN apt-get install ffmpeg libsm6 libxext6 -y ---> Using cache ---> 0368543d5f56 Step 6/13 : USER algorithm ---> Using cache ---> 7779e04ba7d1 Step 7/13 : WORKDIR /opt/algorithm ---> Using cache ---> 6d33f49c3213 Step 8/13 : ENV PATH="/home/algorithm/.local/bin:${PATH}" ---> Using cache ---> 34b1fc4932fd Step 9/13 : RUN python -m pip install --user -U pip ---> Using cache ---> 1c2f03a52c0d Step 10/13 : COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/ ---> Using cache ---> 3d48e4242396 Step 11/13 : RUN python -m pip install --user -rrequirements.txt ---> Using cache ---> 7e21ea7b224e Step 12/13 : COPY --chown=algorithm:algorithm process.py /opt/algorithm/ ---> Using cache ---> f3c5ec870d51 Step 13/13 : ENTRYPOINT python -m process $0 $@ ---> Using cache ---> 93aa0ab27d1b Successfully built 93aa0ab27d1b Successfully tagged surgtoolloc_trial:latest 1+0 records in 1+0 records out 32 bytes copied, 5.177e-05 s, 618 kB/s surgtoolloc_trial-output-132fc6079e3f4ec0d8acf6af460db725 /input/vid_1_short.mp4 Video file to be loaded: /input/vid_1_short.mp4 62 Unable to find image 'python:3.9-slim' locally 3.9-slim: Pulling from library/python 1efc276f4ff9: Pulling fs layer 126aaa6587b8: Pulling fs layer e35bea92ae69: Pulling fs layer 0a238512fbde: Pulling fs layer 5c5fa7d86537: Pulling fs layer 5c5fa7d86537: Waiting 0a238512fbde: Waiting 126aaa6587b8: Download complete 0a238512fbde: Verifying Checksum 0a238512fbde: Download complete 5c5fa7d86537: Verifying Checksum 5c5fa7d86537: Download complete e35bea92ae69: Verifying Checksum e35bea92ae69: Download complete 1efc276f4ff9: Verifying Checksum 1efc276f4ff9: Download complete 1efc276f4ff9: Pull complete 126aaa6587b8: Pull complete e35bea92ae69: Pull complete 0a238512fbde: Pull complete 5c5fa7d86537: Pull complete Digest: sha256:773ab5acbbd67ee168f1a4ffeac8db8de009ad22fcf509cd6abc7b9907b0cc9c Status: Downloaded newer image for python:3.9-slim [ { "slice_nr": 0, "needle_driver": false, "monopolar_curved_scissor": false, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": true, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": true }, ... { "slice_nr": 61, "needle_driver": false, "monopolar_curved_scissor": false, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": true, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": true } ] Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: '/tmp/expected_output_classification.json' Expected output was not found... surgtoolloc_trial-output-132fc6079e3f4ec0d8acf6af460db725

The code is not finding the /tmp directory. Any idea on how to resolve this issue.

Many thanks and

Kind Regards, Bilal

 Last edited by: bilalUWE on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.

Re: Need help to run docker locally on Ubuntu system  

  By: kbot on Aug. 18, 2022, 10:20 p.m.

Did you snap install docker? Seems this can cause issues with /tmp/ directory https://stackoverflow.com/questions/65267251/docker-bind-mount-directory-in-tmp-not-working

I recommend using apt-get install to install docker on the Ubuntu system.

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 19, 2022, 8:41 p.m.

Dear @kbot

I used the regular install through get-apt install route. Since I am using FastAI so it turned out that there were few other dependencies causing errors with fastai installation. Once fastai installation failed, the rest of the commands after that failed too. I was able to fix fastai errors and move past that stage. But now I am stuck with another error. There is a place in the message log, it says KILLED. Dont know what does that mean. Check the log below:

(base) bilal@my-PC:~/mlworks/surgtoolloc2022-category-1$ sudo bash test.sh Sending build context to Docker daemon 4.703GB Step 1/19 : FROM pytorch/pytorch ---> eb86f059e26c Step 2/19 : RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm ---> Using cache ---> 75c457f74dcf Step 3/19 : RUN mkdir -p /opt/algorithm /input /output /opt/algorithm/models && chown algorithm:algorithm /opt/algorithm /input /output /opt/algorithm/models ---> Using cache ---> 843b7567ee49 Step 4/19 : RUN apt-get update ---> Using cache ---> 4e7017fce5e2 Step 5/19 : RUN apt-get install ffmpeg libsm6 libxext6 -y ---> Using cache ---> 7ef0ed8876df Step 6/19 : USER algorithm ---> Using cache ---> e64895356cde Step 7/19 : WORKDIR /opt/algorithm ---> Using cache ---> 79ed5edc8037 Step 8/19 : ENV PATH="/home/algorithm/.local/bin:${PATH}" ---> Using cache ---> 9d409aca3096 Step 9/19 : RUN python -m pip install --user -U pip ---> Using cache ---> d38f6c1c9530 Step 10/19 : RUN python -m pip install --user -U scikit-image ---> Using cache ---> 6145eff6c339 Step 11/19 : COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/ ---> Using cache ---> f22b30dc17db Step 12/19 : RUN python -m pip install --user -rrequirements.txt ---> Using cache ---> 668ba8e28218 Step 13/19 : COPY --chown=algorithm:algorithm process.py /opt/algorithm/ ---> Using cache ---> 970c205a8987 Step 14/19 : COPY --chown=algorithm:algorithm ml_utils.py /opt/algorithm/ ---> Using cache ---> 23ce5bfdea7e Step 15/19 : COPY --chown=algorithm:algorithm test/ /opt/algorithm/test/ ---> Using cache ---> 75ba40efc346 Step 16/19 : COPY --chown=algorithm:algorithm output/ /output/ ---> Using cache ---> 4fd09c1203e3 Step 17/19 : COPY --chown=algorithm:algorithm models/cls/ /opt/algorithm/models/cls/ ---> Using cache ---> f2860f654d9c Step 18/19 : COPY --chown=algorithm:algorithm models/seg/ /opt/algorithm/models/seg/ ---> Using cache ---> 10a1a654679d Step 19/19 : ENTRYPOINT python -m process $0 $@ ---> Using cache ---> 1b0bcc2c7bc5 Successfully built 1b0bcc2c7bc5 Successfully tagged surgtoolloc_trial:latest 1+0 records in 1+0 records out 32 bytes copied, 5.1373e-05 s, 623 kB/s surgtoolloc_trial-output-3a2ee8f8927ac7c6a774abca9a3d1ce5 Killed [ { "slice_nr": 0, "needle_driver": true, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false }, ... { "slice_nr": 61, "needle_driver": true, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false } ] Tests successfully passed... surgtoolloc_trial-output-3a2ee8f8927ac7c6a774abca9a3d1ce5

I have also tried to put the docker container through the preliminary testing online on grand challenge website. It was uploaded but it is not started. Would you please provide me with some guidance on what am I doing wrong that is causing this error.

I will greatly appreciate your help on this.

Many thanks and

Kind regards, Bilal

 Last edited by: bilalUWE on Aug. 15, 2023, 12:57 p.m., edited 4 times in total.

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 19, 2022, 11:15 p.m.

Hi Organising Team,

I resolved the previous issue which was related to the docker memory. Now the Killed message has disappeared.

Now I am stuck with permission denied error. As part of my predict method, I need to extract images in the same folder where video is located which is meant to the /input folder. While the docker user should have all the permission on this folder due to chown command listed in the Dockerfile but it seems like the user doesn't have the write permission. I am receving the permission denied error when the extract_images is trying to save images to the /input folder. Please check the log below:

(base) bilal@my-PC:~/mlworks/surgtoolloc2022-category-1$ sudo bash test.sh Sending build context to Docker daemon 5.753GB Step 1/19 : FROM pytorch/pytorch ---> eb86f059e26c Step 2/19 : RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm ---> Using cache ---> 75c457f74dcf Step 3/19 : RUN mkdir -p /opt/algorithm /input /output /opt/algorithm/models && chown -R algorithm:algorithm /opt/algorithm /input /output /opt/algorithm/models ---> Using cache ---> 474f2d8ad39c Step 4/19 : RUN apt-get update ---> Using cache ---> 242f83e5e36d Step 5/19 : RUN apt-get install ffmpeg libsm6 libxext6 -y ---> Using cache ---> 8a405da87543 Step 6/19 : USER algorithm ---> Using cache ---> 46ec900ce515 Step 7/19 : WORKDIR /opt/algorithm ---> Using cache ---> 602cda5aa0bf Step 8/19 : ENV PATH="/home/algorithm/.local/bin:${PATH}" ---> Using cache ---> 6215d6cd4c10 Step 9/19 : RUN python -m pip install --user -U pip ---> Using cache ---> 83cb1bb23096 Step 10/19 : RUN python -m pip install --user -U scikit-image ---> Using cache ---> 37ee103baa43 Step 11/19 : COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/ ---> Using cache ---> 8a280c8995c8 Step 12/19 : RUN python -m pip install --user -rrequirements.txt ---> Using cache ---> d75a44dd79f0 Step 13/19 : COPY --chown=algorithm:algorithm process.py /opt/algorithm/ ---> 991f818ffa0f Step 14/19 : COPY --chown=algorithm:algorithm ml_utils.py /opt/algorithm/ ---> 31c802430d33 Step 15/19 : COPY --chown=algorithm:algorithm test/ /opt/algorithm/test/ ---> 7af9ee9a1337 Step 16/19 : COPY --chown=algorithm:algorithm output/ /output/ ---> bef3f867bd1b Step 17/19 : COPY --chown=algorithm:algorithm models/cls/ /opt/algorithm/models/cls/ ---> f8e4f4f8501f Step 18/19 : COPY --chown=algorithm:algorithm models/seg/ /opt/algorithm/models/seg/ ---> 658b1b4facf2 Step 19/19 : ENTRYPOINT python -m process $0 $@ ---> Running in dc5526c3b80b Removing intermediate container dc5526c3b80b ---> 16842c162a7b Successfully built 16842c162a7b Successfully tagged surgtoolloc_trial:latest 1+0 records in 1+0 records out 32 bytes copied, 4.4833e-05 s, 714 kB/s surgtoolloc_trial-output-56208e7ec54147fd1a2379e47edf6257 [ WARN:0@16.680] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (773) imwrite_ imwrite_('/input/0.jpg'): can't open file for writing: permission denied [ WARN:0@16.682] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (773) imwrite_ imwrite_('/input/1.jpg'): can't open file for writing: permission denied [ WARN:0@16.682] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (773) imwrite_ imwrite_('/input/2.jpg'): can't open file for writing: permission denied ... [ WARN:0@16.713] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (773) imwrite_ imwrite_('/input/59.jpg'): can't open file for writing: permission denied /input/vid_1_short.mp4 Loading, extracting and cropping video file: /input/vid_1_short.mp4 0 images in the /input are found Traceback (most recent call last): File "/opt/conda/lib/python3.7/runpy.py", line 193, in run_module_as_main "__main__", mod_spec) File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/algorithm/process.py", line 205, in Surgtoolloc_det().process() File "/home/algorithm/.local/lib/python3.7/site-packages/evalutils/evalutils.py", line 183, in process self.process_cases() File "/home/algorithm/.local/lib/python3.7/site-packages/evalutils/evalutils.py", line 191, in process_cases self._case_results.append(self.process_case(idx=idx, case=case)) File "/opt/algorithm/process.py", line 134, in process_case scored_candidates = self.predict(case.path) #video file > load evalutils.py File "/opt/algorithm/process.py", line 156, in predict self.crop_images(self._input_path) File "/opt/algorithm/process.py", line 84, in crop_images preds, = self.crop_learner.get_preds(dl=self.crop_learner.dls.test_dl(fs)) File "/home/algorithm/.local/lib/python3.7/site-packages/fastai/data/core.py", line 533, in test_dl ) if isinstance(self.valid_ds, (Datasets, TfmdLists)) else test_items File "/home/algorithm/.local/lib/python3.7/site-packages/fastai/data/core.py", line 511, in test_set if rm_tfms is None: rm_tfms = [tl.infer_idx(get_first(test_items)) for tl in test_tls] File "/home/algorithm/.local/lib/python3.7/site-packages/fastai/data/core.py", line 511, in if rm_tfms is None: rm_tfms = [tl.infer_idx(get_first(test_items)) for tl in test_tls] File "/home/algorithm/.local/lib/python3.7/site-packages/fastai/torch_core.py", line 581, in get_first return getattr(c, 'iloc', c)[0] File "/home/algorithm/.local/lib/python3.7/site-packages/fastcore/foundation.py", line 112, in getitem def getitem(self, idx): return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None) File "/home/algorithm/.local/lib/python3.7/site-packages/fastcore/foundation.py", line 116, in _get if is_indexer(i) or isinstance(i,slice): return getattr(self.items,'iloc',self.items)[i] IndexError: list index out of range [ { "slice_nr": 0, "needle_driver": true, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false }, {...}, { "slice_nr": 60, "needle_driver": true, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": false, "bipolar_forceps": false, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false } ] Tests successfully passed... surgtoolloc_trial-output-56208e7ec54147fd1a2379e47edf6257

Can some one guide me how to resolve this issue? I tried adding `RUN chmod 755 /input` to the `Dockerfile` but no success.

I will greatly appreciate any ideas to get through this error.

Many thanks and

Kind regards,
Bilal
 Last edited by: bilalUWE on Aug. 15, 2023, 12:57 p.m., edited 4 times in total.

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 21, 2022, 8:05 p.m.

Dear Organising Team,

Just to let you know that I was able to resolve the error. I have to grant access to the folders in Dockerfile and save images in a separate folder. Now I am facing the following two errors: 1. The provided github image is not letting me to utilise the GPU. This might be due to the different type and drivers of the GPU on my local computer than grand challenge environment. Running models on CPU are working perfect. 2. I am still getting the /tmp/tool-presence.json file. I did a bit of debugging. Our code generates the JSON file in output folder. Can anyone explain when and what process creates the JSON file in /tmp folder.

See the entire log of the run below:

(base) bilal@my-PC:~/mlworks/surgtoolloc2022-category-1$ sudo bash test.sh Sending build context to Docker daemon 5.753GB Step 1/20 : FROM pytorch/pytorch ---> eb86f059e26c Step 2/20 : RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm ---> Using cache ---> f893c9eee374 Step 3/20 : RUN mkdir -p /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models/cls /opt/algorithm/models/seg && chown algorithm:algorithm /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models/cls /opt/algorithm/models/seg ---> Using cache ---> dd81f0223cce Step 4/20 : RUN apt-get update ---> Using cache ---> c7b531e2346a Step 5/20 : RUN apt-get install ffmpeg libsm6 libxext6 -y ---> Using cache ---> ab7b2c0f35fb Step 6/20 : USER algorithm ---> Using cache ---> 10d62fc1aa99 Step 7/20 : WORKDIR /opt/algorithm ---> Using cache ---> 3cdbf3ed9cfd Step 8/20 : ENV PATH="/home/algorithm/.local/bin:${PATH}" ---> Using cache ---> 2d776d4c2f47 Step 9/20 : RUN python -m pip install --user -U pip ---> Using cache ---> 4a0d7ce02cc8 Step 10/20 : RUN python -m pip install --user -U scikit-image ---> Using cache ---> 1320866264fd Step 11/20 : COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/ ---> Using cache ---> 813aa54954ac Step 12/20 : RUN python -m pip install --user -rrequirements.txt ---> Using cache ---> 9fc4ff685b6d Step 13/20 : COPY --chown=algorithm:algorithm process.py /opt/algorithm/ ---> Using cache ---> 9678cb32cf26 Step 14/20 : COPY --chown=algorithm:algorithm ml_utils.py /opt/algorithm/ ---> Using cache ---> aa6889a71f85 Step 15/20 : COPY --chown=algorithm:algorithm test/ /opt/algorithm/input/ ---> Using cache ---> 811b3371ad5b Step 16/20 : COPY --chown=algorithm:algorithm output/ /output/ ---> d700a852d84e Step 17/20 : COPY --chown=algorithm:algorithm models/cls/ /opt/algorithm/models/cls/ ---> aa1b91b27c1c Step 18/20 : COPY --chown=algorithm:algorithm models/seg/ /opt/algorithm/models/seg/ ---> 1fed28f527ba Step 19/20 : RUN chmod -R 777 /input /output /images /opt/algorithm ---> Running in 993e63ce5a61 Removing intermediate container 993e63ce5a61 ---> 32812a4be384 Step 20/20 : ENTRYPOINT python -m process $0 $@ ---> Running in b99c34aad810 Removing intermediate container b99c34aad810 ---> c6c156e4c8e4 Successfully built c6c156e4c8e4 Successfully tagged surgtoolloc_trial:latest 1+0 records in 1+0 records out 32 bytes copied, 5.3061e-05 s, 603 kB/s surgtoolloc_trial-output-05f0f8e01616d482329407b5d24ba41f

TeamZERO prediction engine has started!. -Loading key artefacts... -3 mutli-class classification models have been detected & loaded. -Segmntation model for image cropping is also loaded!. -Tools dictionary loaded!.

/input/vid_1_short.mp4 Processing the video file: /input/vid_1_short.mp4 through TeamZERO prediction engine

-Image extraction started.. --60 images from /input/vid_1_short.mp4 are extracted in /images folder. Extraction done!.

-Image cropping begun for 60 images... /opt/conda/lib/python3.7/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory warn(f"Failed to load image Python extension: {e}") --60 images have been croppped. Cropping done!.

-Tools presence detection started. epoch train_loss valid_loss usm1_loss usm2_loss usm3_loss usm4_loss usm1_err usm2_err usm3_err usm4_err combo_err time
epoch train_loss valid_loss usm1_loss usm2_loss usm3_loss usm4_loss usm1_err usm2_err usm3_err usm4_err combo_err time
epoch train_loss valid_loss usm1_loss usm2_loss usm3_loss usm4_loss usm1_err usm2_err usm3_err usm4_err combo_err time
--Predictions from all models in the ensemble learner are obtained!.
--Translation of class probabilities to tool labels is done!. --Following tools remained unaccounted for: {'nan'}. Please ensure if it is OK to skip these tools from the output. --Output JSON file generated & returned!.

/input/vid_1_short.mp4 has been successfully processed!. [ { "slice_nr": 0, "needle_driver": false, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": true, "bipolar_forceps": true, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false }, {...}, { "slice_nr": 59, "needle_driver": false, "monopolar_curved_scissor": true, "force_bipolar": false, "clip_applier": false, "tip_up_fenestrated_grasper": false, "cadiere_forceps": true, "bipolar_forceps": true, "vessel_sealer": false, "suction_irrigator": false, "bipolar_dissector": false, "prograsp_forceps": false, "stapler": false, "permanent_cautery_hook_spatula": false, "grasping_retractor": false } ] Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: '/tmp/expected_output_classification.json' Expected output was not found... surgtoolloc_trial-output-05f0f8e01616d482329407b5d24ba41f

I am uploading this image to the grant challenge algorithms and see what will happen.

Please let me know how to use GPU and get rid of /tmp/*.json file not found error.

Many thanks and

Kind Regards, Bilal

 Last edited by: bilalUWE on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 21, 2022, 9:56 p.m.

Tried uploading the .ZIP docker file (~7GB) to the grand challenge system for this competition. The upload went well but now the algirthm card displayed that the docker is not usable. I waited for a while with the hope that it might take some time for the online system to configure/start the docker for testing it out.

After a while, I went to make a submission. I give it a name and chosen the algorithm. The system says: This algorithm does not have a usable container image. Please add one and try again.

May I ask for the logs to see what is going wrong? Additionally, any idea why to resolve will be greatly appreciated.

Re: Need help to run docker locally on Ubuntu system  

  By: aminey on Aug. 22, 2022, 9:21 a.m.

Hi BilalUWE,

Thanks for sharing your progress. How did you grant access to the folders in Dockerfile and save images in a separate folder? I passed the local testing but I am still trying to solve the permission problem.

Also, did you have to make any modifications to test.sh to make it run?

Regards,

 Last edited by: aminey on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.
Reason: Another question

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 23, 2022, 9:55 a.m.

Hi @aminey:

I changed to the Dockerfile by creating a directory /images and assinging full permission to the algorithms user using the following commands. I then used this directory in the cv2.imwrite() function for saving images. Stopped using the self._input_files or whatever in my code. It is working perfect so far.

RUN mkdir -p /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models/cls /opt/algorithm/models/seg \ && chown algorithm:algorithm /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models/cls /opt/algorithm/models/seg

RUN chmod -R 777 /input /output /images /opt/algorithm

Please add the chmod line at the end of the Dockerfile before the ENTRYPOINT python -m process $0 $@ to ensure that agorithm has the full permission on all the folders and contents inside.

  1. I didn't change anything in the test.sh file but thinking to remove the \tmp file check in the last docker run command to get all the system to pass the tests. I couldn't figure out what it is and seems unnecessary at this stage.

I hope this is helpful.

Regards, Bilal

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 23, 2022, 10 a.m.

One more thing: the docker runs perfectly on the local server on the CPU but fails to run on the grant challenge website. The system says it has failed one or more cases.

Re: Need help to run docker locally on Ubuntu system  

  By: aminey on Aug. 23, 2022, 10 a.m.

Hi BilalUWE,

Thanks for your reply. I am also currently stuck at the /tmp thing where the docker can't find the /output/results.json. Was this problem solved for you?

[cat: /output/results.json: No such file or directory Expecting value: line 1 column 1 (char 0) test.sh: line 28: python:3.9-slim: command not found Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: '/tmp/expected_output_detection.json' Expected output was not found...

UPDATE: The problem was solved by renaming the output files in this line

python:3.9-slim python -c "import json, sys; f1 = json.load(open('/output/surgical-tools.json')); f2 = json.load(open('/tmp/surgical-tools.json')); sys.exit(f1 != f2);"
 Last edited by: aminey on Aug. 15, 2023, 12:57 p.m., edited 4 times in total.

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 23, 2022, 9:54 p.m.

Hi @aminey,

Thanks for the tip. I renamed both files similarly in the test.sh as you suggested and it worked perfectly. Much apprecited. This seems like all the issues with docker have been resolved except one with the GPU which I believe is due to my system GPUs RTX 3090 Ti and Cuda version so I won't bother about that. I will package it and try it out on the online system to see if it works to make a proper submission.

Another thing I noticed that you can get the logs for your algorithm container from the Grand Challenge website. This is the first time, I have ever participated in such competitions so learned few things during the process.

Wish you the very best of luck.

Many thanks and

Kind regards, Bilal

 Last edited by: bilalUWE on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.

Re: Need help to run docker locally on Ubuntu system  

  By: aminey on Aug. 23, 2022, 10:02 p.m.

Hi Bilal,

I also have an RTX 3090 that doesn't work with cuda 10.2 that comes with the pytorch image. I fixed that by by commenting out the first line "FROM pytorch/pytorch" and replace it with a python 3.9 image and then install the torch, torchvision and torchaudio separately along with cuda 11.3 fir thr RTX 3090

FROM python:3.9

RUN python -m pip install torch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 --extra-index-url https://download.pytorch.org/whl/cu113

Re: Need help to run docker locally on Ubuntu system  

  By: bilalUWE on Aug. 23, 2022, 10:10 p.m.

Hi @aminey,

Thanks for sharing this for local GPU error resolution.

Did you try your docker out on the Grand challenge system with the python3.9 image and custom torch and cuda installation? If it works then I will also change accordingly.

Re: Need help to run docker locally on Ubuntu system  

  By: aminey on Aug. 24, 2022, 8:01 a.m.

When I try the "try-out" feature in the website, I can see that model is running correctly but when I try to submit, I get an error saying that the output is not in the correct format, it should be multiple 2D bounding boxes. I hope this will be fixed soon

Re: Need help to run docker locally on Ubuntu system  

  By: kbot on Aug. 24, 2022, 6:29 p.m.

Hi aminey,

The meachanics of the evaluation for Prelim Category 1 and 2 is actually working correctly. Only the metric being computed for Prelim Category 2 is incorrect. So you should be able to successfully run a submission and get a result -- although the result for Prelim Category 2 will be 0.

If you are getting errors on the Grand Challenge platform, it means you still need to debug your code so the correct file formats are generated. As you can see on the Leaderboard, many have been able to successfully submit to Prelim Category 2. However, they all have a score of zero since the metric is not being computed correctly.

Hope this helps clarify some details.

Best, The organizers