def load_model(model_file, agent_models, agent_opts):
    with open(model_file, 'rb') as f:
        state = torch.load(f)
    for i in range(2):
        agent_models[i].load_state_dict(state[('agent%s' % i)]['model_state'])
        agent_opts[i].load_state_dict(state[('agent%s' % i)]['opt_state'])
    episode = state['episode']
    start_time = (time.time() - state['elapsed_time'])
    return (episode, start_time)
def load_model(model_file, agent_models, agent_opts):
    with open(model_file, 'rb') as f:
        state = torch.load(f)
    for i in range(2):
        agent_models[i].load_state_dict(state[('agent%s' % i)]['model_state'])
        agent_opts[i].load_state_dict(state[('agent%s' % i)]['opt_state'])
    episode = state['episode']
    start_time = (time.time() - state['elapsed_time'])
    return (episode, start_time)