[Python] I keep getting the same error when using input_dim and input_shape

Discussão em 'Python' iniciado por Stack, Dezembro 21, 2024.

  1. Stack

    Stack Membro Participativo

    When I specify the data with 11 attributes to the artificial neural network, I constantly get this error when using input_dim and input_shape. How can I fix this error?

    `

    import keras
    from keras.models import Sequential
    from keras.layers import Dense
    classifer=Sequential()
    classifer.add(Dense(6, activation = 'relu',input_shape=(11,)))


    /opt/anaconda3/lib/python3.12/site-packages/keras/src/layers/core/dense.py:87: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
    super().__init__(activity_regularizer=activity_regularizer, **kwargs)
    `

    Continue reading...

Compartilhe esta Página