How to load a parrallel model with one gpu?

I have trained one model in two gpus and saved it.

And now I want to reload it just in one gpu,the error cause which says

Missing key(s) in state_dict: “base_network.conv1.weight”,
Unexpected key(s) in state_dict: “module.base_network.conv1.weight”

It seems save a multi-gpu model will get a prefix name module. Is there a more elegant way rather than using model_state_dict = state_dict[7:]?

You could save the model.module.state_dict() as described in this tutorial instead of model.state_dict(). If you cannot change it now (as the state_dict was already saved), your approach seems to be the correct workaround.