I’m working through the TensorFlow Introduction Lab for my assignment. While I am getting successful outputs for most of the code, there is one fixed section of code (which I can’t modify) that is throwing an error.
Here are the steps I’ve taken to troubleshoot:
Rebooted the server
Updated to the latest version of TensorFlow
Tried running it in Cognito mode
However, none of these steps have resolved the issue. Has anyone encountered a similar problem? Any guidance would be appreciated!
Tom’s point is that the whole purpose of that cell is to test your forward_propagation function, which it does by calling it, although you don’t see the call directly in that code: it passes your function as an argument to the test function. You can examine the source code for the test function by clicking “File → Open” and then opening the file public_tests.py.
The larger moral of the story here is “If the test fails, the solution is not to change the test”. The solution is to figure out why your code fails the test.
The first step is to read the error output carefully and understand what it is telling you. That failing assertion is checking that the shape of the return value of your function is (6,2), which is what it should be given the shapes of the inputs from the particular test case they are using. So what shape is your output? You can put a print statement right before the return or write your own test cell to find out. Then once you see what the wrong value is, the question is how it got that way.
Update: Actually you can see the shape in the output image you showed: your Z3 has one extra dimension and comes out with shape (1,6,2). So how did that happen?