Index Out of range error when converting my Jupyter Notebook into Kubeflow pipline with Kale

288 views Asked by At

I am running a simple ANN model on a Jupyter Notebook Server in Kubeflow. I ran my code in my notebook to see if it worked, and everything ran just fine with expected outputs.

However, when I use Kale to convert the notebook into a Kubeflow pipeline, I'm getting the following error: error message in load_data logs during my load_data step. Here is my code block that works in the notebook: working codeblock

Does anyone know what the error could be? If anyone would like steps to recreate the environment, please let me know.

Here is my code for reference: https://github.com/sumanthnallamotu/kale/blob/master/artificial_neural_network.ipynb

1

There are 1 answers

0
Sumanth Nallamotu On

Fixed it. In your function definitions, if you're dealing with indexes, make sure to pass them as parameters. For example:

def example(x): return x[2]

should actually be:

def example(x, index): return x[index]

Otherwise, you will get a list index out of range error when converting the notebook into a KF pipeline through Kale because Kale will read it as if you are accessing the arbitrary x in your function definition.