There was a problem compiling the code from your notebook. Details: in user code:

File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 878, in train_function *
return step_function(self, iterator)
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 867, in step_function **
outputs =, args=(data,))
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 860, in run_step **
outputs = model.train_step(data)
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 810, in train_step
y, y_pred, sample_weight, regularization_losses=self.losses)
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 184, in call
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 133, in build
self._losses = tf.nest.map_structure(self._get_loss_object, self._losses)
File “/opt/conda/lib/python3.7/site-packages/keras/engine/”, line 273, in _get_loss_object
loss = losses_mod.get(loss)
File “/opt/conda/lib/python3.7/site-packages/keras/”, line 2134, in get
return deserialize(identifier)
File “/opt/conda/lib/python3.7/site-packages/keras/”, line 2093, in deserialize
printable_module_name=‘loss function’)
File “/opt/conda/lib/python3.7/site-packages/keras/utils/”, line 709, in deserialize_keras_object
f’Unknown {printable_module_name}: {object_name}. Please ensure ’

ValueError: Unknown loss function: mean_loss_error. Please ensure this object is passed to the `custom_objects` argument. See for details.

model.compile(optimizer =‘sgd’, loss =‘mean_loss_error’)

I’m getting this message after submitting the assignment for grading. I appreciate the help!


Here is the documentation on what loss functions Keras supports:

“mean_loss_error” isn’t one of them.