I am having an issue with the C2_W3_Assignment Neural Network with Two Layers for the Calculus for Machine Learning Course. I have passed all unit tests but get the following error for Exercise 3:
Failed test case: The output of the initialize_parameters function has incorrect type…
Expected:
<class ‘dict’>,
but got:
<class ‘NoneType’>.
The variable ‘parameters’ is already defined as a dictionary and even the return type of print(type(parameters)) is <class ‘dict’>. Has anyone encountered or solved a similar error?
while adding the bias, you were suppose to use np.zeros((a,b)) to initialise a matrix of shape (a,b) with zeros. So when you don’t use that extra tuple, it might be throwing that nonetype error.
Also point to check, for weight np.random.randn need to be used.
another issue to check exercise 2 for layer size. check while writing codes for size of input layer and output layer, your code has used X.shape[0] or Y.shape[0]
Thank you for the input. However, the program itself it not throwing an error, I have passed the unit test for all exercises. I have used two pairs of brackets for np.zeros, used np.random.randn for the weights, and 0 for the shape parameters of X and Y.
The problem comes in the grading. When I print the output of the function I get a dictionary and the type of the output is <class ‘dict’>. I added two lines of code before the unit test to confirm the output of the function.
Just make sure to avoid such failed test errors avoid editing, adding or deleting anything beyond assigned markers ###YOUR CODE START HERE and ###YOUR CODE END HERE as your codes were perfectly right yet your initialise parameter for test cell where failing.