Inference failed. View the submission for more details

Hi @YaoLin and welcome to the challenge :partying_face:!

That’s why we’re here :muscle:

About the imports :inbox_tray:

You need only define your imports in the specified area in the notebook and it should work fine and be imported throughout. Though multiple imports won’t hurt anyway :+1:

About errors in general :hammer_and_wrench:

Generally for submissions we provide the full traceback of the error on your training data. In your case you can see the link to the error here, where it says “[generate-predictions]”:

Your specific error :floppy_disk:

In your specific case if you click on that link you will find the following which says that you should be using the native save and load functions for xgboost to save your model. Now if you are saving multiple models then please see this discussion on how to do that.

Traceback (most recent call last):
  File "predict.py", line 30, in <module>
    model = load_model(submission_config["model_path"])
  File "/home/aicrowd/load_model.py", line 7, in load_model
    return pickle.load(target)
  File "/usr/local/lib/python3.8/site-packages/xgboost/core.py", line 1087, in __setstate__
    _check_call(
  File "/usr/local/lib/python3.8/site-packages/xgboost/core.py", line 189, in _check_call
    raise XGBoostError(py_str(_LIB.XGBGetLastError()))
xgboost.core.XGBoostError: [17:32:31] ../src/learner.cc:922: Check failed: header == serialisation_header_: 

  If you are loading a serialized model (like pickle in Python) generated by older
  XGBoost, please export the model by calling `Booster.save_model` from that version
  first, then load it back in current version.  There's a simple script for helping
  the process. See:

    https://xgboost.readthedocs.io/en/latest/tutorials/saving_model.html

  for reference to the script, and more details about differences between saving model and
  serializing.

I hope this helps :slight_smile: