[Python] Neural Networks Not working for Movie dataset

Discussão em 'Python' iniciado por Stack, Fevereiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    [​IMG]

    These are codes I used through Python to try neural networks to find the predicted revenue based on these predictors. When I tried to fit the model, I got the following error:

    ValueError: Exception encountered when calling Sequential.call().

    Input 0 of layer "dense_2" is incompatible with the layer: expected axis -1 of input shape to have value 3, but received input with shape (None, 14)

    Arguments received by Sequential.call():

    • inputs=tf.Tensor(shape=(None, 14), dtype=float32)

    • training=True

    • mask=None

    I already knew that the problem that needs to be resolved is to reshape the NumPy array to a 2 dimensional array or add a second dimension to the data. I tried the functions .reshape(-1,1) and np.expand_dims but nothing seems to be working

    Does anyone know on how to rectify this problem? Thank you very much.

    Continue reading...

Compartilhe esta Página