Lung cancer submission error

Lung cancer submission error  

  By: MaiAShaaban on Jan. 2, 2024, 5:26 p.m.

Hi all, I'm getting the following message when trying the Try Out Algorithm: "Unexpected Error Something went wrong..." I'm not getting any logs, and my algorithm "Failed on one or more cases" upon submission. The container passes my internal tests. What may be the issue here?

Re: Lung cancer submission error  

  By: wan77pc on Jan. 5, 2024, 12:20 a.m.

Hi, I got the same error. I have tried many times.

Re: Lung cancer submission error  

  By: anajimenez on Jan. 5, 2024, 2:07 p.m.

Dear MaiAShaaban, I cannot find your submission, when did you submitted it?

Dear wan77pc, I see the following Exception in your submission:

2024-01-05T02:46:40.774000+00:00 Traceback (most recent call last): 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/encode.py", line 224, in _encode 2024-01-05T02:46:40.774000+00:00 return _map_to_integer(values, uniques) 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_encode.py", line 164, in _map_to_integer 2024-01-05T02:46:40.774000+00:00 return np.array([table[v] for v in values]) 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_encode.py", line 164, in 2024-01-05T02:46:40.774000+00:00 return np.array([table[v] for v in values]) 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_encode.py", line 158, in __missing__ 2024-01-05T02:46:40.774000+00:00 raise KeyError(key) 2024-01-05T02:46:40.774000+00:00 KeyError: None 2024-01-05T02:46:40.774000+00:00 2024-01-05T02:46:40.774000+00:00 During handling of the above exception, another exception occurred: 2024-01-05T02:46:40.774000+00:00 2024-01-05T02:46:40.774000+00:00 Traceback (most recent call last): 2024-01-05T02:46:40.774000+00:00 File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main 2024-01-05T02:46:40.774000+00:00 return _run_code(code, main_globals, None, 2024-01-05T02:46:40.774000+00:00 File "/usr/lib/python3.10/runpy.py", line 86, in _run_code 2024-01-05T02:46:40.774000+00:00 exec(code, run_globals) 2024-01-05T02:46:40.774000+00:00 File "/opt/app/process.py", line 114, in 2024-01-05T02:46:40.774000+00:00 Lungcancerosprediction().predict() 2024-01-05T02:46:40.774000+00:00 File "/opt/app/process.py", line 91, in predict 2024-01-05T02:46:40.774000+00:00 clinical_info[i] = le.transform([clinical_info[i]])[0] 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_set_output.py", line 142, in wrapped 2024-01-05T02:46:40.774000+00:00 data_to_wrap = f(self, X, args, *kwargs) 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/preprocessing/_label.py", line 139, in transform 2024-01-05T02:46:40.774000+00:00 return _encode(y, uniques=self.classes) 2024-01-05T02:46:40.774000+00:00 File "/usr/local/lib/python3.10/dist-packages/sklearn/utils/_encode.py", line 226, in _encode 2024-01-05T02:46:40.774000+00:00 raise ValueError(f"y contains previously unseen labels: {str(e)}") 2024-01-05T02:46:40.774000+00:00 ValueError: y contains previously unseen labels: None

Hope it's useful. Bests, Ana

Re: Lung cancer submission error  

  By: WhyNot on Jan. 5, 2024, 5:35 p.m.

Hello,

I also got an error "Failed The algorithm failed on one or more cases".

Could you kindly provide me the log of my submission ?

Many thanks,

Re: Lung cancer submission error  

  By: MaiAShaaban on Jan. 5, 2024, 9:19 p.m.

My teammate submitted using this username: mfarnas

Please help me identify the problem.

 Last edited by: MaiAShaaban on Jan. 5, 2024, 9:19 p.m., edited 1 time in total.

Re: Lung cancer submission error  

  By: anajimenez on Jan. 6, 2024, 5:11 p.m.

@MaiAShaaban The error is an invalid output generation: Error Message: The output file 'overall-survival-months.json' is not valid

The output of your algorithm must be a JSON file named "overall-survival-months.json" stored in "/output" with the value (float number) of your survival prediction.

Re: Lung cancer submission error  

  By: anajimenez on Jan. 6, 2024, 5:13 p.m.

@WhyNot it seems you have a problem when importing numpy. This is the error raised by your container: NameError: name 'np' is not defined

Re: Lung cancer submission error  

  By: mfarnas on Jan. 6, 2024, 7:59 p.m.

Dear @anajimenez, thank you for sharing the error log. I can confirm that our JSON file is as you mentioned. I've sent an email with further details on our submission. I'd appreciate if you can give us further guidance there. Thank you.

 Last edited by: mfarnas on Jan. 6, 2024, 8:13 p.m., edited 1 time in total.

Re: Lung cancer submission error  

  By: khatridhruv on Jan. 7, 2024, 9:26 a.m.

Hi, Could you please also share my error log? I have tried submitting multiple times but I get the same error: "Failed: The algorithm failed on one or more cases". My docker file with local images works fine. I can't really debug this without the error log. Could you please forward it to my email id : khatridhruv95@gmail.com. Thank you , Best.

Update : Try out algorithm gives this error: Unexpected Error Something went wrong... I uploaded a .nii and the corresponding .json file

 Last edited by: khatridhruv on Jan. 7, 2024, 9:47 a.m., edited 2 times in total.

Re: Lung cancer submission error  

  By: anajimenez on Jan. 7, 2024, 12:59 p.m.

Dear @khatridhruv this is the error causing the failure of your submission: 2024-01-07T09:10:03.473000+00:00 TypeError: Object of type float32 is not JSON serializable

It seems you are having problems when saving the JSON file with the survival time. Try to force float() native python format before storing the value in the JSON file.

 Last edited by: anajimenez on Jan. 7, 2024, 1:07 p.m., edited 3 times in total.

Re: Lung cancer submission error  

  By: khatridhruv on Jan. 7, 2024, 6:42 p.m.

hi, Great help Thank you! The only step i choose to ignore caused the error, you learn something everyday.

Re: Lung cancer submission error  

  By: wan77pc on Jan. 8, 2024, 3:15 a.m.

Dear anajimenez

Thank you for sending me the error message. But I think this is not my algorithm, because I submit my algorithm in Jan. 4, 2024, 12:32 p.m. The message you send is in 2024-01-05T02:46:40. I carefully checked my method, and I didn't find the same error.

Could you please help me find my log again?

Thank you! wan77pc

Re: Lung cancer submission error  

  By: anajimenez on Jan. 8, 2024, 4:28 p.m.

Dear @wan77pc,

Sorry for that! This was the issue causing your issue:

2024-01-04T04:40:11.977000+00:00 TypeError: Object of type float32 is not JSON serializable

I would suggest forcing the output value to float() native Python format before storing it in the JSON file. It seems this is causing problems. I can also see that the output if the inference is generating a negative survival time. This should be a positive value.

Hope this helps!

Re: Lung cancer submission error  

  By: agaldran on Jan. 8, 2024, 6 p.m.

Hola Ana,

I am in trouble here. My survival prediction algorithm saves the prediction as a plain python float (overall_survival = float(overall_survival)) in a file called '/output/overall-survival-months.json', so I should be fine. Locally, it processes .mha images without any problem and produces the expected output. However, when I submit it I get the dreadful error message "Failed: The algorithm failed on one or more cases." 

The Try Out Algorithm feature is not helpful, as it says that something unexpected happened and provides no clue of what's wrong. Can you please try to find the log and the error message in my submission? It's my latest one, which I created in "Jan. 8, 2024, 6:47 p.m.". 

Any prompt help is appreciated, seeing as there is little time left.. Thanks!

 Last edited by: agaldran on Jan. 8, 2024, 6:01 p.m., edited 1 time in total.

Re: Lung cancer submission error  

  By: mfarnas on Jan. 8, 2024, 6:53 p.m.

Dear @anajimenez, would you be able to share our latest error log? We've confirmed that the JSON file name and output path are as mentioned, and that we're forcing the output to float. We're also getting the expected JSON output from our internal testings. However, our submissions still failed. We've sent further details of our submission to chaimeleon@quibim.com.

        # path to output files
        self.os_output_file = Path("/output/overall-survival-months.json")

        print('OS (months): ', overall_survival)

        # save case-level class
        with open(str(self.os_output_file), 'w') as f:
            json.dump(float(overall_survival), f)

Any help would be appreciated!

 Last edited by: mfarnas on Jan. 8, 2024, 6:58 p.m., edited 2 times in total.