Week 2 - convolutional_block "Wrong values when training=True."

I am getting the error:

“Wrong values when training=True.” on the conbolutional block assigment. Not sure what i am doing wrong i didnt pass any training parameters on the first assigment and the tests all checked up.

Could you guys help me?

1 Like

I suggest comparing your code with the instructions. It is normal to make mistakes on the first attempt but rereading the instructions carefully will help.

I did that, can i share my code here?

The error block is the following:

I also searched for the error in the forum and i found that could be a missmatch of versions of the glorot_uniform initializer but changing the version didnt helped me.

You cannot share your code here but you can send me in a direct message. Click my name and message. I will check it in 30 mins.

Hello, I have the same error as him. Is there any solution to this case?

You need to very carefully check your code against the instructions. There are lots of details here and many things that could go wrong.

I have already tried my best to figure out and re-check the instructions but I still don’t get it…

Nevermind sir. I solved it :smiley: .thanks for the support

That’s great news that you found the solution by your own thinking. Nice work!

how did you solve it , please?

I was misspelling a very little part of my code. If it’s also happen to you, I advice you to check it more deeply because it was also took 1-2 hours of my time at the time :smiley: Good luck!

1 Like

Solved :slight_smile:

Any chance you could have a look at mine for this exercise as well? I’m getting the same error, have read every thread on this forum about this exercise, and have compared my code with the instructions numerous times … still getting the same error.

Hi, Rod.

It’s the middle of the night on Saif’s time, but it’s morning where I am. Please check your DMs for a message from me. Note that mentors do not have the “superpower” to just look directly at anyone else’s notebooks.


Just to close the loop on the public thread: rather than being a typo with one of various parameters, it turned out to be the other common mistake, which was to use the wrong input to the “shortcut” layer.

The verbal descriptions in the instructions may leave a little bit to be desired, but this is the classic case in which the pictures are worth the proverbial thousand words. :laughing:

Interestingly I get this error running the notebook locally (my own machine), but not in the remote notebook.

That could well be because of “versionitis”. The notebooks here run pretty old versions of TF and all the other packages. Most of them were last upgraded in April 2021 at which point TF 2.3 was the active version.

I just checked and the Residual Assignment is running TF 2.9.1, but that is still pretty old compared to the current release.

I checked the TF version, and installed the same as the remote notebook, but haven’t checked numpy and other dependencies’ versions