Bounds error for MINST training

Hi I am new to Julia Pluto and was wondering if you could help. I have a bounds error and not sure what would be causing this issue, I understand what a bounds issue is I’m just not sure what is causing it. any help would be really apperciated. Thanks for any help!

Your array has 3 dimensions and you’re trying to access it with 4.

You haven’t included all of the error message but I suppose it is train_x as that has 4 dimensions in your snippet.

So wherever that is assigned is where your problem might lie.

I would advise reading this advice

Thanks very much for the help that fixed my issue!