Closed vijender412 closed 4 years ago
did you use data parallel to train the model?
@abhishekkrthakur Yes used data parallel while training
does your bert_base_path has bert base uncased model files?
@abhishekkrthakur Fixed the issue was with data parallel. I local i was not making use of "MODEL = nn.DataParallel(MODEL)". Now working with this. Can you help me understand the use of DataParallel and if it does require after training also? Thanks for quick replying. Good to close the issue
DataParallel is used only when you have multiple GPUs during training. If you used it in training, you have to use in inference but there are other ways too.
Closing this issue for now. :)
@abhishekkrthakur : Can you give any leads on how to load DataParallel
GPU model on CPU?
As per pytorch docs tried following but still raises above RuntimeError
device = torch.device('cpu')
model = TheModelClass(*args, **kwargs)
model.load_state_dict(torch.load(PATH, map_location=device))
Getting below issue while loading the model in local system. Model was trained on colab.