title: AttributeError: 'Sequential' object has no attribute 'ndim'
body: <p>I'm new to doing machine learning projects. I have started using keras for developing minor projects.
  Recently I faced an error with my program. I executed the following program. I used the Sequential model for the development:</p>
  
  <pre><code>f=Sequential()
  f.add(Dense(64,input_shape=(9,),activation='relu'))
  f.add(Dense(128,activation='tanh'))
  f.add(Dense(128,activation='relu'))
  f.add(Dense(64,activation='tanh'))
  f.add(Dense(1,activation='sigmoid'))
  f.compile(loss='binary_crossentropy',optimizer='rmsprop',metrics=['accuracy'])
  f.fit(d,f,epochs=20,batch_size=10)
  </code></pre>
  
  <p>It shows the following error:</p>
  
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-7-4d0153cd53cb&gt; in &lt;module&gt;
       36 f.add(Dense(1,activation='sigmoid'))
       37 f.compile(loss='binary_crossentropy',optimizer='rmsprop',metrics=['accuracy'])
  ---&gt; 38 f.fit(d,f,epochs=20,batch_size=10)
  
  ~\Anaconda3\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, ` 
   verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, 
   initial_epoch, steps_per_epoch, validation_steps, **kwargs)`
      950             sample_weight=sample_weight,
      951             class_weight=class_weight,
  --&gt; 952             batch_size=batch_size)
      953         # Prepare validation data.
      954         do_validation = False
  
  
  
   ~\Anaconda3\lib\site-packages\keras\engine\training.py in _standardize_user_data(self, x, y, 
     sample_weight, class_weight, check_array_lengths, batch_size)
          787                 feed_output_shapes,
          788                 check_batch_axis=False,  # Don't enforce the batch size.
      --&gt; 789                 exception_prefix='target')
          790 
          791             # Generate sample-wise weight values given the `sample_weight` and
  
      ~\Anaconda3\lib\site-packages\keras\engine\training_utils.py in standardize_input_data(data, names, 
     shapes, check_batch_axis, exception_prefix)
           90         data = data.values if data.__class__.__name__ == 'DataFrame' else data
           91         data = [data]
      ---&gt; 92     data = [standardize_single_array(x) for x in data]
           93 
           94     if len(data) != len(names):
  
      ~\Anaconda3\lib\site-packages\keras\engine\training_utils.py in &lt;listcomp&gt;(.0)
           90         data = data.values if data.__class__.__name__ == 'DataFrame' else data
           91         data = [data]
      ---&gt; 92     data = [standardize_single_array(x) for x in data]
           93 
           94     if len(data) != len(names):
  
  
  
   ~\Anaconda3\lib\site-packages\keras\engine\training_utils.py in standardize_single_array(x)
           25                 'Got tensor with shape: %s' % str(shape))
           26         return x
      ---&gt; 27     elif x.ndim == 1:
           28         x = np.expand_dims(x, 1)`enter code here`
           29     return x
  
          AttributeError: 'Sequential' object has no attribute 'ndim'
  </code></pre>
  
  <p>Is the error due to my wrong coding or is it because of any internal problems?</p>
  
  <p>Any advice will be helpful.</p>