Practice Lab: Neural Networks for Binary Classification in machine learning specialization.
Error Detail :
Cell #9. Can’t compile the student’s code. Error: AssertionError(‘Wrong number of units in layer 0. Expected [None, 25] but got [None, 64]’)
Traceback (most recent call last):
File “/home/www/app/grading/exceptions.py”, line 112, in handle_solution_errors
yield {}
File “/home/www/app/grading/abstract.py”, line 393, in _grade
context = compiled_code.run(cell_index=cell.index)
File “/home/www/app/grading/submission/compiled_code.py”, line 195, in run
return list(self._code_items.values())[cell_num - 1].run()
File “/home/www/app/grading/submission/compiled_code.py”, line 54, in run
return import_module(self.import_statement, items)
File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/tmp/student_solution_cells/cell_9.py”, line 14, in
test_c1(model)
File “/tmp/public_tests.py”, line 21, in test_c1
f"Wrong number of units in layer {i}. Expected {expected[i][1]} but got {layer.output.shape.as_list()}"
AssertionError: Wrong number of units in layer 0. Expected [None, 25] but got [None, 64]
I am not sure which course this is in the ML specialization but you posted under general discussions; you need to post in the respective specialization and course!
This is the error you are getting: Cell #9. Can’t compile the student’s code. Error: AssertionError(‘Wrong number of units in layer 0. Expected [None, 25] but got [None, 64]’)
This means your input to layer zero of your model is not correct; check what size you are inputting to layer 0 of the model!
Use the instructions in Section 2.3 of the notebook to add three “Dense()” statements, where inside the parenthesis you put the correct number of units for that layer, and an argument for the activation type.
Use the “Click for hints” link below the ‘Expected Output’ to see exactly how to write this code.