Week2 - Assignment 1 (Conv2D issue)

Hello Dear Community,

I have the following issue. When trying to implement Convolutional Block, I don´t get the test passed due to the following error: ““AssertionError: Wrong values when training=False.””

I looked into my code very carefully and I think it is OK, however, I think the error is because the output is compared to fixed values pulled from a library “outputs” by the name of convolutional_block_output1 and convolutional_block_output2 (for training = false or true respectively).

I found that the function Conv2D does not always output the same values even if the inputs parameters are fixed. Everytime I run the function Conv2D (keeping the same input parameteres), the output changes. And the reason is that the “seed=0” in Glorot_Uniform distribution DOES not guarantee the same random values across multiple calls.

This is what TensorFlow documentation says about “seed” parameter within initializers.GlorotUniform distribution:

seed : A Python integer. Used to make the behavior of the initializer deterministic. Note that a seeded initializer will not produce the same random values across multiple calls, but multiple initializers will produce the same sequence when constructed with the same seed value.

How would I pass the test if output comparators (convolutional_block_output1&2) are constant and everytime I run Conv2D I get different kernel initialization (even with “seed” parameter fixed to 0)?

Thanks for your valuable help,

Boris M.

If you are using your local environment, this may help you.

Thank you very much!