title: AttributeError: 'Sequential' object has no attribute 'model'
body: <pre><code>from tensorflow.keras.layers import Dense, Activation
  from tensorflow.keras.models import Sequential, load_model
  from tensorflow.keras.optimizers import Adam
  
  def build_dqn(lr, n_actions, input_dims, fc1_dims, fc2_dims):
      model = Sequential([
          Dense(fc1_dims, input_shape=(input_dims,)),
          Activation('relu'),
          Dense(fc2_dims),
          Activation('relu'),
          Dense(n_actions)])
  
      model.compile(optimizer=Adam(lr=lr), loss='mse')
  
      return model
  </code></pre>
  <p>I am trying to understand Double Deep Q-Learning. There is a pretty good lecture here: <a href="https://github.com/philtabor/Youtube-Code-Repository/tree/master/ReinforcementLearning/DeepQLearning" rel="nofollow noreferrer">https://github.com/philtabor/Youtube-Code-Repository/tree/master/ReinforcementLearning/DeepQLearning</a></p>
  <p>But when I tried to run the code, I got following errors:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/panda/PycharmProjects/ddqn/main.py&quot;, line 33, in &lt;module&gt;
      ddqn_agent.learn()
    File &quot;/home/panda/PycharmProjects/ddqn/ddqn_keras.py&quot;, line 118, in learn
      self.update_network_parameters()
    File &quot;/home/panda/PycharmProjects/ddqn/ddqn_keras.py&quot;, line 121, in update_network_parameters
      self.q_target.model.set_weights(self.q_eval.model.get_weights())
  AttributeError: 'Sequential' object has no attribute 'model'
  </code></pre>
  <p>And I have no clue on how to fix this. I guess keras has been updated to not allow this?</p>
  <p>The different lines are respectively:</p>
  <p><strong>line 33:</strong></p>
  <pre><code>ddqn_agent.learn()
  </code></pre>
  <p><strong>line 118 (in <code>def learn(self):</code>):</strong></p>
  <pre><code>self.update_network_parameters()
  </code></pre>
  <p><strong>line 121 (in <code>def update_network_parameters(self):</code>):</strong></p>
  <pre><code>self.q_target.model.set_weights(self.q_eval.model.get_weights())
  </code></pre>
  <p><strong>line 76:</strong></p>
  <pre><code>self.q_target = build_dqn(alpha, n_actions, input_dims, 256, 256)
  </code></pre>
  <p><strong>EDIT:</strong> updated the problem based on suggestions in the comment section. The suggestion was that I put a <code>tensforflow.</code> in front of keras in the imports. I get the same error as before (as you can see). Here is how the imports look like now:</p>
  <p><a href="https://i.stack.imgur.com/WhvDx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WhvDx.png" alt="enter image description here" /></a></p>