title: Keras AttributeError: 'History' object has no attribute 'predict'
body: <blockquote>
    <p><strong>Note</strong>: I have seen this <a href="https://stackoverflow.com/questions/45537372/attributeerror-history-object-has-no-attribute-predict-fitting-a-list-of">related post</a> but I don't know I can use
    the answer for my problem.</p>
  </blockquote>
  
  <p>I try to use Keras for a simple regression. For this I have created a simple <code>policy_network()</code> function, which returns me the model.</p>
  
  <pre><code>def policy_network():
      model = Sequential()
      model.add(MaxPooling2D(pool_size=(4, 4),input_shape=[64,64,3]))
      model.add(Flatten())
      model.add(Dense(1, kernel_initializer='normal', activation='linear'))
  
      model.compile(loss='mean_squared_error',
                    optimizer=Adam(lr=learning_rate),
                    metrics=['mean_squared_error'])
  
      return model
  </code></pre>
  
  <p>I also have defined a global variable <code>policy_network</code>. I use the following assignment</p>
  
  <pre><code>policy_network = policy_network().fit(images, actions,
                    batch_size=256,
                    epochs=10,
                    shuffle=True)
  </code></pre>
  
  <p>but when I call</p>
  
  <pre><code>action = policy_network.predict(image)
  </code></pre>
  
  <p>I get the <code>AttributeError: 'History' object has no attribute 'predict'</code></p>