Closed Abdelkader-gnichi closed 1 year ago
AttributeError Traceback (most recent call last) Cell In[15], line 33 31 ddqnagent.remember(observation, action, reward, observation, int(done)) 32 observation = observation_ ---> 33 ddqn_agent.learn() 34 eps_history.append(ddqn_agent.epsilon) 36 ddqn_scores.append(score)
Cell In[14], line 116, in DDQNAgent.learn(self) 113 self.epsilon = self.epsilon*self.epsilon_dec if self.epsilon > \ 114 self.epsilon_min else self.epsilon_min 115 if self.memory.mem_cntr % self.replace_target == 0: --> 116 self.update_network_parameters()
Cell In[14], line 119, in DDQNAgent.update_network_parameters(self) 118 def update_network_parameters(self): --> 119 self.q_target.model.set_weights(self.q_eval.model.get_weights())
AttributeError: 'Sequential' object has no attribute 'model'
i fixed it just remove the model attribute from self.q_target.model.set_weights(self.q_eval.model.get_weights()) --> self.q_target.set_weights(self.q_eval.get_weights() )
AttributeError Traceback (most recent call last) Cell In[15], line 33 31 ddqnagent.remember(observation, action, reward, observation, int(done)) 32 observation = observation_ ---> 33 ddqn_agent.learn() 34 eps_history.append(ddqn_agent.epsilon) 36 ddqn_scores.append(score)
Cell In[14], line 116, in DDQNAgent.learn(self) 113 self.epsilon = self.epsilon*self.epsilon_dec if self.epsilon > \ 114 self.epsilon_min else self.epsilon_min 115 if self.memory.mem_cntr % self.replace_target == 0: --> 116 self.update_network_parameters()
Cell In[14], line 119, in DDQNAgent.update_network_parameters(self) 118 def update_network_parameters(self): --> 119 self.q_target.model.set_weights(self.q_eval.model.get_weights())
AttributeError: 'Sequential' object has no attribute 'model'