Output directory 'images/aorta-segmentation' is empty

Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 12, 2023, 2:55 a.m.

Hello, I tried my algorithm on the Grand Challenge algorithm page, but the results are as follows:

Stdout 2023-07-11T15:53:16.445000+00:00 --------------slice by slice predicting-------------- 2023-07-11T15:53:16.445000+00:00 --------------with out of post process-------------- 2023-07-11T15:53:21.446000+00:00 Save finish prediction:0a81a0ff-7cc4-48c9-a016-e67debad4302.mha 2023-07-11T15:53:21.446000+00:00 All Case Predicton Finished!

Stderr 2023-07-11T15:53:10.442000+00:00 2023-07-11T15:53:10.442000+00:00 0%| | 0/1 [00:00<?, ?it/s] 2023-07-11T15:53:10.442000+00:00 100%|██████████| 1/1 [00:00<00:00, 30174.85it/s] 2023-07-11T15:53:21.446000+00:00 2023-07-11T15:53:21.446000+00:00 0%| | 0/19 [00:00<?, ?it/s] 2023-07-11T15:53:21.446000+00:00 5%|▌ | 1/19 [00:01<00:35, 1.96s/it] 2023-07-11T15:53:21.446000+00:00 11%|█ | 2/19 [00:02<00:15, 1.12it/s] 2023-07-11T15:53:21.446000+00:00 16%|█▌ | 3/19 [00:02<00:08, 1.81it/s] 2023-07-11T15:53:21.446000+00:00 21%|██ | 4/19 [00:02<00:05, 2.55it/s] 2023-07-11T15:53:21.446000+00:00 26%|██▋ | 5/19 [00:02<00:04, 3.28it/s] 2023-07-11T15:53:21.446000+00:00 32%|███▏ | 6/19 [00:02<00:03, 3.98it/s] 2023-07-11T15:53:21.446000+00:00 37%|███▋ | 7/19 [00:02<00:02, 4.60it/s] 2023-07-11T15:53:21.446000+00:00 42%|████▏ | 8/19 [00:02<00:02, 5.12it/s] 2023-07-11T15:53:21.446000+00:00 47%|████▋ | 9/19 [00:03<00:01, 5.55it/s] 2023-07-11T15:53:21.446000+00:00 53%|█████▎ | 10/19 [00:03<00:01, 5.87it/s] 2023-07-11T15:53:21.446000+00:00 58%|█████▊ | 11/19 [00:03<00:01, 6.10it/s] 2023-07-11T15:53:21.446000+00:00 63%|██████▎ | 12/19 [00:03<00:01, 6.29it/s] 2023-07-11T15:53:21.446000+00:00 68%|██████▊ | 13/19 [00:03<00:00, 6.43it/s] 2023-07-11T15:53:21.446000+00:00 74%|███████▎ | 14/19 [00:03<00:00, 6.53it/s] 2023-07-11T15:53:21.446000+00:00 79%|███████▉ | 15/19 [00:04<00:00, 6.59it/s] 2023-07-11T15:53:21.446000+00:00 84%|████████▍ | 16/19 [00:04<00:00, 6.65it/s] 2023-07-11T15:53:21.446000+00:00 89%|████████▉ | 17/19 [00:04<00:00, 6.69it/s] 2023-07-11T15:53:21.446000+00:00 95%|█████████▍| 18/19 [00:04<00:00, 6.69it/s] 2023-07-11T15:53:21.446000+00:00 100%|██████████| 19/19 [00:04<00:00, 6.70it/s] 2023-07-11T15:53:21.446000+00:00 100%|██████████| 19/19 [00:04<00:00, 4.11it/s]

Re: Output directory 'images/aorta-segmentation' is empty  

  By: giansteve on July 12, 2023, 7:23 a.m.

Hi OnlyCar,

I am sorry but we can not find your submission to the challenge in the submission list. Also, based on what you just pasted here, I do not see where is the problem. Could you please be more specific on that?

Best Gian Marco

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 12, 2023, 10:23 a.m.

Hello, I would like to ask, is the mount output path of the test '/output/images/aorta-segmentation'? Because the path I output is '/output/', I feel like this error will occur.However, when I change the output path to '/output/images/aorta-segmentation', I get the error that the output cannot be written: ITK ERROR: MetaImageIO(0x55c13afc9110): File cannot be written: /output/images/aorta-segmentation/ae38faa0-716a-4c41-b24a-9e0953ee2182.mha Reason: No such file or directory。

And, I tried to create the folder: /output/images/aorta-segmentation, but I don't have permission to write, please how can I fix it?

Re: Output directory 'images/aorta-segmentation' is empty  

  By: apepe on July 13, 2023, 9:41 a.m.

Hi,

I do not see any submission with your username. I assume that your issue is on your local machine?

The Dockerfile template sets the right permissions to the /output directory. The reason why we set /output as main output directory is because the three outputs (segmentation, mesh1, mesh2) have different output paths. Therefore we simply create the subpath for the segmentation at runtime in the template.

I would advise you to compare your current version to the original template.

Best, Antonio

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 13, 2023, 3:26 p.m.

Hello, thank you for your reply!

I followed the template of dockerfile and created the following folder: RUN mkdir -p /opt/app /input /output && chown user:user /opt/app /input /output.

I found that when I replace the statement with: RUN mkdir -p /opt/app /input /output/images/aorta-segmentation && chown user:user /opt/app /input /output/images/aorta-segmentation. I get the following error: Could not clean '/input' and/ or '/output' directories:[Errno 13] Permission denied:'aorta-segmentation'. I don't know why, I hope you can help me answer it, I'm just one step away from this last output, thank you very much!

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 14, 2023, 8:25 a.m.

Hello, can you help me take a look at the latest submitted error details?

Re: Output directory 'images/aorta-segmentation' is empty  

  By: apepe on July 15, 2023, 1:38 p.m.

Hi,

I do not see any error in the logs, but the system shows "Output directory 'images/aorta-segmentation' is empty".

Perhaps you uploaded a container with your local paths/interfaces?

Best Antonio

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 15, 2023, 3:08 p.m.

Hello, thank you for your reply. How can I set the path creation statement in my dockerfile,which is :RUN mkdir -p /opt/app /input /output \ && chown user:user /opt/app /input /output or RUN mkdir -p /opt/app /input /output/images/aorta-segmentation \ && chown user:user /opt/app /input /output/images/aorta-segmentation?

Re: Output directory 'images/aorta-segmentation' is empty  

  By: apepe on July 15, 2023, 3:37 p.m.

Hi,

For the submission you do not need to edit the dockerfile of the template, unless you need, for example, more COPY statements for your scripts/models.

Was this your question?

Antonio

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 16, 2023, 10:26 a.m.

Hello, thank you for your reply.

I didn't change the dockerfile template, and the split output path I used in the process.py was "/output/images/aorta-segmentation", but the predicted output was not written in, and the error was(in Try-out Algorithm): ITK ERROR: MetaImageIO(0x55fff01890b0): File cannot be written: /output/images/aorta-segmentation/1e336cb0-a2b3-42e8-afe7-6ae9d500b225.mha Reason: No such file or directory.

Want to ask, how do I fix this error? Or can you use the split output in "/output/" for DICE calculations? Because Ireplaced the split output path with "/output" to successfully output.

Thank you so much!!!

 Last edited by: OnlyCar on Aug. 15, 2023, 12:58 p.m., edited 2 times in total.

Re: Output directory 'images/aorta-segmentation' is empty  

  By: apepe on July 17, 2023, 12:58 p.m.

Hi,

perhaps the final answer to this post also helps with your issue

https://grand-challenge.org/forums/forum/segmentation-modeling-and-meshing-of-the-aortic-vessel-tree-694/topic/the-algorithm-failed-on-one-or-more-cases-1581/

Let me know Antonio

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 18, 2023, 3:02 a.m.

Hello.

Can you help me see the details of the latest submitted bug?

I experimented with the algorithm in the "Try-out Algorithm" and did not get any errors, as follows: Error Message:No errors were reported in the logs.

Thank you so much!!!

Re: Output directory 'images/aorta-segmentation' is empty  

  By: giansteve on July 18, 2023, 7:11 a.m.

Hi,

the error message on your last submission produced the following error: "Reason: No such file or directory" and the following Traceback error was given:

2023-07-18T02:23:57.365000+00:00 Traceback (most recent call last):
2023-07-18T02:23:57.365000+00:00   File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
2023-07-18T02:23:57.365000+00:00     return _run_code(code, main_globals, None,
2023-07-18T02:23:57.365000+00:00   File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
2023-07-18T02:23:57.365000+00:00     exec(code, run_globals)
2023-07-18T02:23:57.365000+00:00   File "/opt/app/process.py", line 449, in <module>
2023-07-18T02:23:57.365000+00:00     predictor(net, input_path=input_path, output_path=output_path)
2023-07-18T02:23:57.365000+00:00   File "/opt/app/process.py", line 426, in predictor
2023-07-18T02:23:57.365000+00:00     predictor_single_volume(image, net, patch_size=[224, 224],
2023-07-18T02:23:57.365000+00:00   File "/opt/app/process.py", line 407, in predictor_single_volume
2023-07-18T02:23:57.365000+00:00     sitk.WriteImage(resample_image,
2023-07-18T02:23:57.365000+00:00   File "/home/user/.local/lib/python3.9/site-packages/SimpleITK/extra.py", line 405, in WriteImage
2023-07-18T02:23:57.365000+00:00     return writer.Execute(image)
2023-07-18T02:23:57.365000+00:00   File "/home/user/.local/lib/python3.9/site-packages/SimpleITK/SimpleITK.py", line 7913, in Execute
2023-07-18T02:23:57.365000+00:00     return _SimpleITK.ImageFileWriter_Execute(self, *args)
2023-07-18T02:23:57.365000+00:00 RuntimeError: Exception thrown in SimpleITK ImageFileWriter_Execute: /tmp/SimpleITK-build/ITK/Modules/IO/Meta/src/itkMetaImageIO.cxx:1103:
2023-07-18T02:23:57.365000+00:00 ITK ERROR: MetaImageIO(0x55a07fbc1980): File cannot be written: /output/images/aorta-segmentation/bc5eae0e-1bc8-468a-98a2-00547e42ed2c.mha
2023-07-18T02:23:57.365000+00:00 Reason: No such file or directory

Best Gian Marco

Re: Output directory 'images/aorta-segmentation' is empty  

  By: apepe on July 18, 2023, 8:36 a.m.

In our implementation we provided the folder creation in the constructor of the algorithm: https://github.com/apepe91/SEGA2023/blob/901ce64f72d6414ee6de50f93ba8ef7b9e207a47/SegaAlgorithm/process.py#L24

whereas the output folder is created in the dockerfile https://github.com/apepe91/SEGA2023/blob/901ce64f72d6414ee6de50f93ba8ef7b9e207a47/SegaAlgorithm/Dockerfile#L5

Could you double check that this is the case also for your implementation?

Best Antonio

Re: Output directory 'images/aorta-segmentation' is empty  

  By: OnlyCar on July 18, 2023, 12:37 p.m.

Hello, thank you very much for your reply!

I'm pretty sure that the folders and paths I created inside dockerfile and process.py are the same as templates.

I have a problem, the dockerfile template does not create the "/output/images/aorta-segmentation" directory, but process.py uses this directory for prediction storage, which is a problem in itself? Of course, I can use the OS library inside the process.py to create the "/output/images/aorta-segmentation" directory, but I don't have permission to write files to that folder.

Over the past month, I've spent almost all of my time on submit algorithms and debugs, which wastes a lot of my time, not to mention exploring new segmentation methods to improve DICE values. I guess it's not just me alone, as you can see from the leaderboard, which has made a lot of challengers abandon the game.

I hope that the official will publish a template for submitting successful cases for our reference, including process.py that use the evalutils library and those that do not use the evalutils library, as well as dockerfiles, etc.

Thank you so much!!!