Failed with exit code 1

Hi there,

I’m trying to submit via Google Colab (Python submission) but I’m getting the “Failed with exit code 1” error. It is working fine and predicting the prices on the Colab notebook.

Not sure if this is related to additional packages but I have added xgboost into the additional packages section of the config.

Has anyone come across this error and managed to fix it?



Could you please give me your submission number or link me to your submission so that I can investigate further?

Hi @alfarzan,

The submission ID is 111246 .

Thanks very much!

Hi @alfarzan,

I also have the same issue google collab submission: 111300

And potentially same issue with zip submission: 111148

Hi @solve_fx and @WHM

It seems this idiosyncratic behaviour is due to the sensitivity of xgboost models being saved with a particular python version, and loaded with a slightly different version.

If you are using xgboost you can either:

  1. Use the native save_model function provided by xgboost (see here). You will then have to use the corresponding load_model provided by the package.
  2. Alternatively, in the config file / description cell in the notebook, you can specify and exact python version which would also prevent this issue.

See a longer discussion on this issue on this thread.

If this doesn’t solve your issues please reply here and we will get to the bottom of it :slight_smile:

Here’s a fresh attempt: 111338

I used xgboost==0.90 as this is the version that google collabs used, which gave the same error. I installed version 1.2.1 but this didn’t work either.

I also tried using the xgboost save/load method, however the load file suggests saving as .model and loading as .bin which doesn’t seem to work in collab. So used .model for both to no success.

Hello @solve_fx

Can you try including libgomp1 in your APT_DEPENDENCIES. Please refer OSError: cannot open shared object file: No such file or directory for more information.

Hi @alfarzan,

I’ve tried using the native save method and it is now generating a new error message of “child ‘submission-h4sxr-3601207088’ failed” - submission ID is 111418. The save/load method was working fine in colab notebook.

Hello @WHM

It seems like setting proper extension matters. I was able to run your code by saving the model to model.bin instead of model.json. Can you try this change and make another submission?

1 Like

Hi @jyotish

Changing the file extension to .bin has worked! Thanks for your help!


@jyotish Adding libgomp1 worked, thank you


Hi, would appreciate some help please.

My submission 111675 has generated exit code 1.

I used xgboost and have specified the version in requirements.txt. I also used save_model and load_model with model.bin as the file name. I submitted using .zip method.


Hi @zhengyh

I believe if you follow the same steps as described here you should be able to run it. You can see an explanation of why on that thread.

In short, you will need to upload an apt.txt file that includes a line with the text libgomp1 and that should be it :slight_smile:

I also got the error “failed with exit code 1”, but I’m in R (using xgboost 0.90.0 as well). I changed the function save_model, to save it with natural xgboost save function, and not save into a Rdata object. I also changed the load_function. Now the error is "REAL() can only be applied to a ‘numeric’, not a ‘logical’ ".

The error “exit code 1” is it similar for Python and R code ?


Hi @demarsylvain

The exit code 1 error comes from improper installation of the xgboost library which is then fixed by following the instructions on this thread.

The other error you mention is R-specific and on the other thread you are following @jyotish will be able to help.

Hi @alfarzan

Sorry to disturb you again. I tried the following without success:

  1. Submission 111794: include “libgomp1” in apt.txt, I got “failed with exit code 137”.

  2. Submission 111797: include “apt-get install libgomp1” in apt.txt, I got “DockerBuildError: The command ‘/bin/sh -c apt -qq update && apt -qq install -y apt-get install libgomp1 && rm -rf /var/lib/apt/*’ returned a non-zero code: 100”.

I believe approach 1 above is the correct one, ie there’s no need to include “apt-get install”. Googling exit code 137 get me this:

  • Exit Code 137: Indicates failure as container received SIGKILL (Manual intervention or ‘oom-killer’ [OUT-OF-MEMORY])

Please kindly help, I really don’t know what else I could do to get this works. Many thanks.

@zhengyh That’s why we’re here :slight_smile:

We’re looking to this for you and I will update you in some time regarding the issue of memory running out.

In the meanwhile, I’ve looked into your code and I think the issue could be that you are treating the vh_make_model as a category without any other preprocessing. The reason this might cause a memory problem is that there are thousands of unique values in that column meaning your resulting dataset will effectively have thousands of features.

If I remove this feature as a categorical feature then I can submit via a colaboratory notebook with your model (of course I set your premiums to zero so I don’t actually submit your model!).

If you want to treat this feature as categorical I recommend doing some preprocessing to see if you can reduce the number of categories.

Thanks @alfarzan, it works now, out-of-memory was indeed due to me being too greedy, the problem is solved after I adopted your suggestion :smiley:

1 Like