title: TypeError: Error converting shape to a TensorShape: int() argument must be a string, a bytes-like object or a number, not 'tuple'. in python
body: <p>I got this error when running the code below that I found online regarding defining the machine learning model:   </p>
  
  <pre><code>raise TypeError("Error converting %s to a TensorShape: %s." % (arg_name, e))
  TypeError: Error converting shape to a TensorShape: int() argument must be a string, a
  bytes-like object or a number, not 'tuple'.
  </code></pre>
  
  <p><b></b></p>
  
  <pre><code>import pandas as pd
  import numpy  as np
  
  customers = pd.read_csv('EcommerceCustomers.csv')
  
  X = customers[['Avg. Session Length', 'Time on App', 'Time on Website','Length of Membership']].values
  y = customers['Yearly Amount Spent'].values
  
  from sklearn.model_selection import train_test_split
  
  X_training, X_testing, Y_training, Y_testing = train_test_split(X, y, test_size=0.30, random_state=101)
  
  Y_training= np.reshape(Y_training, (-1, 1))
  Y_testing= np.reshape(Y_testing, (-1, 1))
  
  from sklearn.preprocessing import MinMaxScaler
  
  X_scaler = MinMaxScaler(feature_range=(0, 1))
  Y_scaler = MinMaxScaler(feature_range=(0, 1))
  
  X_scaled_training = X_scaler.fit_transform(X_training)
  Y_scaled_training = Y_scaler.fit_transform(Y_training)
  
  X_scaled_testing = X_scaler.fit_transform(X_testing)
  Y_scaled_testing = Y_scaler.fit_transform(Y_testing)
  
  print(X_scaled_testing.shape)
  print(Y_scaled_testing.shape)
  
  print("Note: Y values were scaled by multiplying by {:.10f} and adding {:.4f}".format(Y_scaler.scale_[0], Y_scaler.min_[0]))
  
  from keras.models import Sequential
  from keras.layers import Dense
  
  model = Sequential()
  model.add(Dense(50, input_dim=, activation='relu'))
  model.add(Dense(100, activation='relu'))
  model.add(Dense(50, activation='relu'))
  model.add(Dense(1, activation='linear'))
  model.compile(loss="mean_squared_error", optimizer="adam")
  </code></pre>
  
  <p>The error occurrs at this line:</p>
  
  <pre><code>model.add(Dense(50, input_dim=, activation='relu'))`
  </code></pre>
  
  <p>What is the reason for this kind of issue?  I tried many examples, but I couldn't find a solution. </p>