In the DQN algorithm, the agent is trained successfully and the model is saved as a .h5
file.
The agent class has a method called load
as follows:
def load(self):
new_model = load_model('dqn_model.h5')
if self.epsilon == 0.0:
self.update_network_parameters()
return new_model
def update_network_parameters(self):
self.model.set_weights(self.new_model.get_weights())
I try to run the evaluation step by creating the new_model
as follows:
new_model = agent.load()
but the new_model
doesn't have any method like predict
.