Most likely torch.load() returned a state_dict, which would create the issue, if you are trying to call to() on the OrderedDict.
The proper way of restoring the model is to initialize the model and load the state_dict afterwards:
model = models.resnet18()
state_dict = torch.load(...)
model.load_state_dict(state_dict)
model.to(device)

CC @dong-mvp