the_model = torch.load(path)

if isinstance(the_model, torch.nn.DataParallel):
           the_model = the_model.module

the_model.load_state_dict(torch.load(path))

In the last line above, load_state_dict() method expects an OrderedDict to parse and call the items() method of OrderedDict object. Since your file saves the entire model, torch.load(path) will return a DataParallel object. That’s why you get the error message " ‘DataParallel’ object has no attribute ‘items’.
You seem to use the same path variable in different scenarios (load entire model and load weights).