"Untitled" By CookiePPP (https://pastebin.com/u/CookiePPP) URL: https://pastebin.com/sVdZ5hf2 Created on: Sunday 22nd of December 2019 02:23:08 AM CDT Retrieved on: Saturday 31 of October 2020 11:08:51 PM UTC def warm_start_model(checkpoint_path, model, ignore_layers): assert os.path.isfile(checkpoint_path) print("Warm starting model from checkpoint '{}'".format(checkpoint_path)) checkpoint_dict = torch.load(checkpoint_path, map_location='cpu') model_dict = checkpoint_dict['state_dict'] model.load_state_dict(model_dict) return model