Transfer Learning and Splits API: InvalidArgumentError()

In the Transfer Learning and Splits API assignment, I’m getting the following error when trying to submit: Cell #5. Can’t compile the student’s code. Error: InvalidArgumentError()

I call the map function in my cell #5, and I was thinking that the issue could be in the order of the chained calls to transform the data. Does the order matter? Here is my order on the train examples:

train_batches = train_examples.shuffle(num_examples).batch(BATCH_SIZE).map(format_image)

Do I need to try a different permutation of shuffle, batch, and map? Do I need to call map before shuffle and batch?

I figured it out. Apparently, you have to call map before calling batch.

hi @wmartin :wave:

Yes, this makes sense. You want to format your images before batching them, instead of formatting the batches of images (you can also format images in each of the batches individually, but this will be less convenient).