I try to run the Weeks 2 Ungraded Lab in the online version. However, when training the model for the first time, i get the following error:
Step:
# Create a model to use with the imbalanced dataset
imbalanced_model = lab_utils.create_model()
# Print the model's summary
print(imbalanced_model.summary())
Error:
TypeError Traceback (most recent call last)
Cell In[17], line 2
1 # Create a model to use with the imbalanced dataset
----> 2 imbalanced_model = lab_utils.create_model()
4 # Print the model's summary
5 print(imbalanced_model.summary())
File ~/work/lab_utils.py:67, in create_model()
51 model = tf.keras.Sequential([
52 tf.keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3)),
53 tf.keras.layers.MaxPooling2D((2, 2)),
(...)
62 tf.keras.layers.Dense(3, activation='softmax')
63 ])
66 # Compile the model
---> 67 model.compile(
68 loss='sparse_categorical_crossentropy',
69 optidatamizer='adam',
70 metrics=['sparse_categorical_accuracy']
71 )
73 return model
File /usr/local/lib/python3.11/dist-packages/keras/src/utils/traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
67 filtered_tb = _process_traceback_frames(e.__traceback__)
68 # To get the full stack trace, call:
69 # `tf.debugging.disable_traceback_filtering()`
---> 70 raise e.with_traceback(filtered_tb) from None
71 finally:
72 del filtered_tb
File /usr/local/lib/python3.11/dist-packages/keras/src/engine/training.py:3895, in Model._validate_compile(self, optimizer, metrics, **kwargs)
3893 invalid_kwargs = set(kwargs) - {"sample_weight_mode"}
3894 if invalid_kwargs:
-> 3895 raise TypeError(
3896 "Invalid keyword argument(s) in `compile()`: "
3897 f"{(invalid_kwargs,)}. Valid keyword arguments include "
3898 '"cloning", "experimental_run_tf_function", "distribute",'
3899 ' "target_tensors", or "sample_weight_mode".'
3900 )
3902 # Model must be created and compiled with the same DistStrat.
3903 if self.built and tf.distribute.has_strategy():
TypeError: Invalid keyword argument(s) in `compile()`: ({'optidatamizer'},). Valid keyword arguments include "cloning", "experimental_run_tf_function", "distribute", "target_tensors", or "sample_weight_mode".
Can anyone give me any suggestions what to do about it? It sounds like Keras library doesnât know the optimizer=âadamâ keyword which is in the provided python script.
And other question: Is it possible to somehow reset the complete workspace, including the Files? Since I already executed the steps above, a additional Folder got created. I would like to restart with a âblankâ workspace.