I have saved the model like

model_state_dict = model.module.state_dict()
torch.save({‘model_state_dict’: model_state_dict},  osp.join(save_dir, ‘best.ckpt’))

Now I try to load the model like

model_path = “./models/best.ckpt”
ckpt = torch.load(model_path)
model.load_state_dict(ckpt[‘model_state_dict’])

then it has the error. There are “position_ids” in model, but not in the saved ckpt file.
Anyway to skip loading position_ids ?