comic/evalutils

Could not load images

Closed this issue · 20 comments

  • evalutils version: 0.1.16
  • Python version: 3.7.1
  • Operating System: windows docker-toolbox

Description

I tested evalutils, but it showed the error:

Could not load 1.2.276.0.28.3.0.14.4.0.20090213134050413.zraw using <evalutils.io.SimpleITKLoader object at 0x7f5bdf2699e8>.
Could not load 1.0.000.000000.0.00.0.0000000000.0000.0000000000.000.zraw using <evalutils.io.SimpleITKLoader object at 0x7f5bdf2699e8>.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/evaluation/evaluation.py", line 57, in
File "/home/evaluator/.local/lib/python3.6/site-packages/evalutils/evalutils.py", line 109, in evaluate
self.load()
File "/home/evaluator/.local/lib/python3.6/site-packages/evalutils/evalutils.py", line 121, in load
folder=self._predictions_path
File "/home/evaluator/.local/lib/python3.6/site-packages/evalutils/evalutils.py", line 142, in _load_cases
f"Could not load and files in {folder} with "
evalutils.exceptions.FileLoaderError: Could not load and files in /input with <evalutils.io.SimpleITKLoader object at 0x7f5bdf2699e8>.

Do you also have the 1.2.276.0.28.3.0.14.4.0.20090213134050413.mhd file in the same directory? A zraw file on its own is not a valid metaio image, you need to include the corresponding mhd file too.

yes, the .mhd file is in the same directory, a warning is also shown, is it related to the error?

SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

image

I also tested detection template, also got an error, can't get init from reference.csv...
I activated python 3.6 environment using conda.
Moreover, I tried wsl ubuntu 16.04, ubunt 18.04 on windows, these systems can not run the test successfully... I even reset my system and changed a computer...

seems hopeless for me..., but I don't have more computers to test...

That should be ok.

You only get the error for the input directory? Which must mean that the ground truth loads ok. The difference between the two is that the ground truth is added to the container, whereas the input is mounted as a docker volume.

What shell are you using? Are you using test.sh or test.bat?

What is the output of this command when run in the same place as test.sh:

docker run --rm -v $(pwd)/test/:/input/ alpine ls -lah /input

Can you check that the input directory (./test) can be shared with your docker daemon. If you're using docker for windows I think you can set this in the docker settings, for windows docker toolbox it might be different (maybe: http://support.divio.com/local-development/docker/how-to-use-a-directory-outside-cusers-with-docker-toolboxdocker-for-windows or https://stackoverflow.com/questions/34161352/docker-sharing-a-volume-on-windows-with-docker-toolbox).

WSL won't work - docker is not supported there and you always end up using docker in the moby vm (which is where I think the problem is here).

Windows support is experimental here and we make a best effort to fix things, but we do all our development under linux and can only test the templates there (there is no free CI service that supports testing linux containers under windows AFAIK).

I am using test.sh, the following is the output of the command:
image

Ok, then its a problem with sharing the directory with docker on your machine. See the 2 links I shared earlier. Use that command to help you debug, if you get it to work you should see all of the files listed.

Also, as a sanity check, what is the output of echo $(pwd)/test?

I am so grateful to your help! I have solved the problem by using evalutils init at $ directory.

Thanks a lot for your quick reply!

No problem! Glad that it works.

sorry, my mistake, the question was still not solved. Today I used another computer with ubuntu installed. I met the same error : could not load files, and the error in windows seems still not be resolved. That made me crazy. I even restore my ubuntu system and windows system, but the question is still there...

I dont know how to solve this, could evalutils run without docker?

Try adding:

COPY --chown=evaluator:evaluator test /input

To line 20 of the generated Dockerfile. Then delete the -v $(pwd)/test:/input from test.sh. Then run test.sh (cd <your working directory> && ./test.sh).

If the images can be loaded then, then this is an issue with Docker. If the images still cannot be loaded with this change then it is something else.

The library will run fine without docker, but you will need to provide a container in the end.

Thanks for your quick reply! I tested the command just now, and the images still couldn’t be loaded.

Ok - can you share the images with me?

But the demo on Ubuntu will give a result even it couldn’t load the images. Weird...

screenshot from 2019-02-18 00-28-57
This is the result.

just used the images produced by evalutils init projectname command.

That is a warning, not an error. The library warns you that it cannot load zraw files directly, but the mhds load fine. The images are loading ok as you're getting the correct result. Those warnings can be ignored.