C2W1 Assignment create_model errors out

After defining the model it is failing at the model.compile:

model.compile(loss=RMSprop(learning_rate=X),
                optimizer='binary_crossentropy',
                metrics=['accuracy']) 

where X is the learning rate value chosen by me

with error being:

ValueError: Unknown optimizer: binary_crossentropy. Please ensure this object is passed to the `custom_objects` argument. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details.

I checked stack overflow but nothing, has someone else ran into this issue?

I fixed this by changing:

model.compile(loss=RMSprop(learning_rate=X),
                optimizer='binary_crossentropy',
                metrics=['accuracy']) 

to the below:

model.summary()
  
  model.compile(optimizer=RMSprop(learning_rate=X),
                loss='binary_crossentropy',
                metrics = ['accuracy'])

not sure why this worked…

Please look at the lectures again. It helps to know the difference between loss function and optimizer. If you’re interested in digging deeper, deep learning specialization is a great place to start.