Deep Learning for Content Based Filtering Error

Hello @Mir_Aayan,

I have edited your post to make the message prettier.

First, we need to locate Cell#14. We go to the assignment, from top to bottom, look for the 14th code cells and we should find this one:

This makes sense because this cell calls, and the error messages were all about kera’s training procedure.

Now what other hints do we have from the message? The following:

ValueError: Input 0 of layer “model” is incompatible with the layer: expected shape=(None, 100), found shape=(None, 14)

It said the model that you provided for training wanted an input with 100 features, but the lab was only giving 14 to it.

Now, 14 is the correct number, and 100 is wrong. You need to figure out where that 100 comes from.

If you go back to cell #12, it should have printed a summary of the model, and below is mine:


See that because num_user_features is 14, my model expects 14 features. Now yours is 100, why is that?

Note that the value of num_user_features is provided to you by the lab, and if you hadn’t changed it, it should remain 14. If you hadn’t changed to use num_user_features as the argument value for creating the Input layer, the model should expect 14 features. You might have changed something.

If you don’t know what you have changed, then I suggest you get a new copy of the notebook by following instructions in B5 of the MLS FAQ.