def create_model(self):
    model = define_model(pretrained=True)
    if self.load_model:
        model_path = os.path.join(self.model_folder, self.load_model)
        model.load_state_dict(torch.load(model_path, map_location=(lambda storage, loc: storage)))
    if self.use_cuda:
        model = model.cuda()
    return model
def create_model(self):
    model = define_model(pretrained=True)
    if self.load_model:
        model_path = os.path.join(self.model_folder, self.load_model)
        model.load_state_dict(torch.load(model_path, map_location=(lambda storage, loc: storage)))
    if self.use_cuda:
        model = model.cuda()
    return model