Deep Learning for Content-Based Filtering C3W2

Im receiving this error when attempting to submit exercise 1 and exercise 2:

Exercise 2:

This is the error i received,

Cell #UNQ_C1. Can’t compile the student’s code. Error: NameError(“name ‘Model’ is not defined”)
Traceback (most recent call last):
File “/home/www/app/grading/”, line 112, in handle_solution_errors
yield {}
File “/home/www/app/grading/”, line 393, in _grade
context =
File “/home/www/app/grading/submission/”, line 195, in run
return list(self._code_items.values())[cell_num - 1].run()
File “/home/www/app/grading/submission/”, line 54, in run
return import_module(self.import_statement, items)
File “/usr/local/lib/python3.7/importlib/”, 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/”, line 48, in
model = Model([input_user, input_item], output)
NameError: name ‘Model’ is not defined

Could anybody help me figure out what is causing this error?

Please do not post your solution code here as it violates the code of conduct.

You must run all of the cells every time you open the notebook.

i apologize for that ill be sure to not show the code next time, is the reason for my error, just running all cells when I open the notebook? Im new to machine learning and this lab is causing me some headaches.

Oops! You have to call this Model() using the tf.keras API.

The open (not-numbered) square brackets in your image for Exercise 2 means that you have not attempted to run those cells.

Please run all of the cells in the notebook before you try to submit it. Post back any error messages you see.

PS: I am not sure whether this lab has been updated. I don’t see the ## marker to edit that line, and the Model() has also not been imported by default at the top cell.

These two lines from Cell 1 handle the necessary import.

import tensorflow as tf
from tensorflow import keras

That allows tf.keras.Model() to be available.
The line model = tf.keras.Model(...) should not be edited. But it appears that it was.
The last update to this notebook was in Feb. 2023.