def recover_state(name, model, optimizer):
    state = model.state_dict()
    model_keys = set(state.keys())
    load_keys = set(states[name]['state_dict'].keys())
    if (model_keys != load_keys):
        print('NOTICE: DIFFERENT KEYS IN THE LISTEREN')
    state.update(states[name]['state_dict'])
    model.load_state_dict(state)
    if args.loadOptim:
        optimizer.load_state_dict(states[name]['optimizer'])
def recover_state(name, model, optimizer):
    state = model.state_dict()
    model_keys = set(state.keys())
    load_keys = set(states[name]['state_dict'].keys())
    if (model_keys != load_keys):
        print('NOTICE: DIFFERENT KEYS IN THE LISTEREN')
    state.update(states[name]['state_dict'])
    model.load_state_dict(state)
    if args.loadOptim:
        optimizer.load_state_dict(states[name]['optimizer'])