W3A1 Problem with one_step_attention function

Hi there

Hoping someone can help me debug my one_step_attention function giving me the error below when running the test code:

Not sure what could be wrong. I checked my code several times without success. Any help appreciated


There are a fair number of “moving parts” there. Are you sure that you are using all the predefined functions that they created (instantiated) for you in the previous cell? E.g. repeator, concatenator, densor1 and so forth. As opposed to creating your own …

Also they try to give pretty helpful hints in the comments in the template code.

If the above two suggestions are not enough to “get you there”, we can move to looking at the code, but we should do that in a private DM thread. I’ll send you a DM about how to do that.

1 Like

Thanks Paulin

Indeed I was block at that function and hadn’t gotten far enough to read this note further down that solved the problem:

Troubleshooting Note

  • If you are getting repeated errors after an initially incorrect implementation of “model”, but believe that you have corrected the error, you may still see error messages when building your model.
  • A solution is to save and restart your kernel (or shutdown then restart your notebook), and re-run the cells.

Thanks for your help!

1 Like

It’s great to hear that you found the solution under your own power. Yes, the state gets very complicated in all the assignments in C5. It’s always a good idea to run everything from a consistent state by doing:

  1. Kernel → Restart and Clear Output
  2. Save
  3. Cell → Run All (or Run All Above)

That will make sure that things are consistent and WYSIWYG.

1 Like