This error is raised, if you’ve stored the state_dict from a DataParallel model and try to load it into a standard model as explained here 1.
You could either store the state_dict via torch.save(model.module.state_dict(), PATH) or remove the .module keys in the current state_dict.