## input_dim, output_dim not working in updated keras

i am doing this online course on udemy and everything works fine but when i try to intialize the first hidden layer it gave the following error

TypeError: __init__() missing 1 required positional argument: 'units'.

then I did the ctrl+I on the spyder and chnged the output_dim and init arguments but i dont know what to replace others with ..

import keras from keras.models import Sequential from keras.layers import Dense #initializing the ANN classifier = Sequential() #adding the input layer and the first hidden layer classifier.add(Dense(units =6, kernel_initializer = 'uniform' , activation = 'relu', input_dim =11 )) #adding the second layer classifier.add(Dense(Output_dim = 6 , kernel_initializer = 'uniform' , activation = 'relu'))

should work fine with no error

In a `Dense`

layer, the number of units is equivalent to the output dimensionality. However, the argument `Output_dim`

does not exist. So, replace `Dense(Output_dim=6, ...)`

with `Dense(units=6, ...)`

(or even just `Dense(6, ...)`

).

**input_dim, output_dim not working in updated keras tensorflow ,** But I am facing some issues in updated keras / tensorflow version. Seems like input_dim, output_dim functions has deprecated. Could you help I am working on a stock prediction assignment and was trying to get some help from your script. But I am facing some issues in updated keras / tensorflow version. Seems like input_dim, output_dim functions has deprecated. Could you help me to update that code for updated version.

In the new documentation of Dense function output_dim is replaced by units, and the input_dim is replaced by input_shape. However in the input_shape argument you have to specify a tuple.

Eg:

Adding the input layer and the first hidden layer

`classifier.add(Dense(units=6, activation = 'relu', kernel_initializer = 'uniform', input_shape = (11, )))`

Adding the second layer

`classifier.add(Dense(units = 6 , kernel_initializer = 'uniform' , activation = 'relu'))`

**update your dense call to the keras 2 · Issue #10395 · keras-team ,** GitHub is home to over 50 million developers working together to host and review code, manage classifier.add(Dense(6, init = 'uniform', activation = 'relu', input_dim = 11)) I resolved this problem by change all output_dim: `output_dim=6 // old output. units=6 // updated output` and. init = 'uniform' // old wights initializer kernel_initializer = 'uniform' // new initializer. i am not sure about the input_dim=11 does it have a updated version as well???

##### Add the first ANN layers (Input and Hidden Layers)

`classifier.add(Dense(units=6, activation='relu', kernel_initializer='uniform', input_dim = 11))`

##### Adding the second hidden layer

`classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu'))`

**The Sequential model,** Embedding(input_dim=1000, output_dim=64)) # Add a LSTM layer with The recorded states of the RNN layer are not included in the In TensorFlow 2.0, the built-in LSTM and GRU layers have been updated to leverage So this does appear to be supported by Keras, there must just be something about your particular example that's causing this to not work as expected. You might want to work backwards from the simplest possible working example into your current code to see where the problem lies.

**Working with RNNs,** Embedding( input_dim, output_dim, embeddings_initializer="uniform", mask_zero: Boolean, whether or not the input value 0 is a special "padding" value that Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

**Embedding layer,** Embedding(input_dim=6, output_dim=2)(cat_indices) encoded_inputs Keras Preprocessing Layers The TensorFlow team is working on providing a set of input_dim: Integer. Size of the vocabulary, i.e. maximum integer index + 1. output_dim: Integer. Dimension of the dense embedding. embeddings_initializer: Initializer for the embeddings matrix (see keras.initializers). embeddings_regularizer: Regularizer function applied to the embeddings matrix (see keras.regularizers).

**Hands-On Machine Learning with Scikit-Learn, Keras, and ,** model = Sequential() model.add(Dense(32, input_dim=784)) model.add(Activation('relu')) for a multi-class classification problem model.compile(optimizer='rmsprop', 256, input_length=maxlen)) model.add(LSTM(output_dim=128, The Keras RNN API is designed with a focus on: Ease of use: the built-in keras.layers.RNN, keras.layers.LSTM, keras.layers.GRU layers enable you to quickly build recurrent models without having to make difficult configuration choices.