Hello,
What is the correct way to get predictions when model is trained with DataParallel?
I’ve trained a model which uses the following to make use of multiple GPUs.
model = nn.DataParallel(model)
I save the model with,
torch.save(model, model_home+‘best_model.pth’)
Load and run predictions:
best_model = torch.load(model_home+‘best_model.pth’)
predictions = best_model.predict(x_tensor)
I run into the below error:
ModuleAttributeError: ‘DataParallel’ object has no attribute ‘predict’
Thanks