(model, ckpt_path, strict=True, map_location="cpu")
| 16 | from torchvision.utils import save_image |
| 17 | |
| 18 | def load_state_dict(model, ckpt_path, strict=True, map_location="cpu"): |
| 19 | print(f"Loading model state dict from {ckpt_path} ...") |
| 20 | state_dict = load_from_pretrain(ckpt_path, map_location=map_location) |
| 21 | state_dict = state_dict.get('state_dict', state_dict) |
| 22 | model.load_state_dict(state_dict, strict=strict) |
| 23 | del state_dict |
| 24 | def get_cond_control(args, batch_data, control_type, device, model=None,batch_size=None, train=True, seg_model=None): |
| 25 | # Single-control |
| 26 | control_type = copy.deepcopy(control_type)[0] |
no test coverage detected