How to debug a container

How to debug a container  

  By: Jardvanroest on May 21, 2024, 4:09 p.m.

I submitted a container to the preliminary classification phase and it gives an accuracy of 0.0%. How do I go about debugging this? It looks like we don't get to see any output of the container. The 'Try-out Algorithm' functionality on the algorithm page does give back a CSV, but that CSV only contains column headers (even for the template submission, so I think it's not my code causing that problem). Without any information it's very hard to know what's going on.

 Last edited by: Jardvanroest on May 21, 2024, 4:20 p.m., edited 1 time in total.

Re: How to debug a container  

  By: tristan on June 4, 2024, 12:27 p.m.

I've just used "Try out container" with an test and get a predictions.csv back which contains one row.

If this CSV was empty, but contains column headers, that leads me to believe either: - the code isn't outputting any data after the csv header, - the container isn't receiving any inputs.

The best thing to do is use "print" logging to print out what input was passed in, and the output that will go into the predictions.csv and then view the "Logs" available after using "Try out container".

Here are the logs I see in my test container:

2024-06-04T12:22:06.280874723Z inputs=[PosixPath('/input/102_20200627234041.jpg')]
2024-06-04T12:22:06.280906778Z values={'image_uid': ['102_20200627234041'], 'level_0': ['Animalia'], 'level_0_probability': [1.0]}
2024-06-04T12:22:06.298995771Z result=            image_uid   level_0  ...  level_5 level_5_probability
2024-06-04T12:22:06.299027604Z 0  102_20200627234041  Animalia  ...      NaN                 NaN
2024-06-04T12:22:06.299033136Z 
2024-06-04T12:22:06.299055368Z [1 rows x 13 columns]

It shows the input file and the values that will go out into the CSV. The CSV appears to match these logs.

Re: How to debug a container  

  By: Jardvanroest on June 12, 2024, 9:01 a.m.

Interesting that you get .jpg as input. For some reason I only get .mha files as inputs (which apparently is the internal file format that Grand Challenge uses to store images). I'm unsure of what's going on here

Re: How to debug a container  

  By: Jardvanroest on June 12, 2024, 11:13 a.m.

I modified my algorithm to parse .mha files. Now the Try-out-algorithm thing works, but when submitting I get the error "pandas.errors.EmptyDataError: No columns to parse from file" which leads me to believe it didn't give any output here. As far as I know, it's not possible to see any output from the container when submitting it (to either preliminary classification phase or classification phase), which brings us back to the same problem: it's very hard, if not impossible, to debug a container when we don't get to see any output from it.

Is there any way it could be made possible to see the logs of your container in the preliminary phase? That would help a lot.

Re: How to debug a container  

  By: CPadubidri on June 14, 2024, 7:54 a.m.

Did you try docker-test.sh? Did you pass this successfully?