Hi there!
I successfully trained my model that was declared as:
model = ModelClass(...)
model = torch.nn.DataParallel(model, device_ids=[0, 1, 2])

During training, I saved my weights like this:
best_model = copy.deepcopy(model.state_dict())
torch.save(best_model, path)

And I could get my weights for test (it isn’t NoneType, I checked):
w = torch.load(path) # type(w) is <class 'collections.OrderedDict'>

But! When I try:
trained_model = model.load_state_dict(w)

I got NoneType! What has happened? Maybe it happens due to DataParallel? What should I do?