W2A1 - TypeError: list indices must be integers or slices, not str

Hello DLAI team,

running Exercise 5 - training_loop UNQ - 8 and receving the following error:

TypeError: list indices must be integers or slices, not str

All exercises prior pass …

How can I resolve this issue ?

Thank you… – German

1 Like

Hi @dlphsrle7

You can send me your notebook and I will try to help. From the image above, everything looks ok.

Cheers

Hello @arvyzukai,

Thank you… this is the notebook - xfysvcptvxhv

// German

Hi @dlphsrle7,

Please be advised, only DeepLearning.AI staff (such as myself) can access your workspace with the lab ID, mentors cannot do that. In the future, if a mentor asks to share code with them, you have to direct message them the code/your notebook.

Best,
Mubsi

I’ve got the same error, and all prior tasks were correct. This is probably something related to the mask.

Please do let me know, once you find the solution.

File […]/trax/layers/core.py, line 256, in forward
mask_shape[axis] = 1

TypeError: list indices must be integers or slices, not str

Hello @Marcin_Sosnowski,

@Mubsi sorted this issue for me… I do not know the root cause…

– Germán

I’m getting the same error. All prior exercises pass. My lab ID is ‘bmhcdbagzano’

I had the same error. Pay attention that mode in Dropout in all previous excersises is not second positional argument.

P.S: Don’t forget to rerun all cells after your fixes

1 Like