title: TypeError: The added layer must be an instance of class Layer
body: <p>I'm trying to do binary logistic regression using Keras. But I'm getting the typeError</p>
  <p><code>TypeError: The added layer must be an instance of class Layer. Found: {&lt;tensorflow.python.keras.layers.core.Dense object at 0x7f2887e399e8&gt;}</code></p>
  <p>This is my headers:</p>
  <pre><code>import numpy as np 
  import pandas as pd 
  from keras.models import Sequential
  from keras.layers import Dense
  import keras.utils
  #from tensorflow.keras import layers
  from keras.optimizers import SGD
  from keras import initializers
  </code></pre>
  <p>this is my code:</p>
  <pre><code>model=keras.Sequential({
      keras.layers.Dense(1,input_shape=(4,),activation='sigmoid',kernel_initializer='zeros',bias_initializer='zeros')
  })
  opt=SGD(learning_rate=0.05)
  model.compile(optimizer=opt,loss='binary_crossentropy',metrics=['binary_accuracy'])
  </code></pre>
  <p>the error which it shows is:</p>
  <pre><code>TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-4-50823f563eb6&gt; in &lt;module&gt;()
        1 model=keras.Sequential({
  ----&gt; 2     keras.layers.Dense(1,input_shape=(4,),activation='sigmoid',kernel_initializer='zeros',bias_initializer='zeros')
        3 })
        4 opt=SGD(learning_rate=0.05)
        5 model.compile(optimizer=opt,loss='binary_crossentropy',metrics=['binary_accuracy'])
  
  3 frames
  /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/sequential.py in add(self, layer)
      180       raise TypeError('The added layer must be '
      181                       'an instance of class Layer. '
  --&gt; 182                       'Found: ' + str(layer))
      183 
      184     tf_utils.assert_no_legacy_layers([layer])
  
  TypeError: The added layer must be an instance of class Layer. Found: {&lt;tensorflow.python.keras.layers.core.Dense object at 0x7f2887e399e8&gt;}
  </code></pre>
  <p>One thing I found peculiar was that I was able to run the same code earlier but now am not able to run it, is there any updates that I'm no familiar of or there is a code error?</p>