logger = get_root_logger()
if opt["path"]["resume_state"]:
// ignore pretrained model paths
if opt["path"].get("pretrain_model_g") is not None or opt["path"].get(
"pretrain_model_d") is not None:
logger.warning(
"pretrain_model path will be ignored during resuming.")
After Change
// set pretrained model paths
for network in networks:
name = f"pretrain_{network}"
basename = network.replace("network_", "")
opt["path"][name] = osp.join(opt["path"]["models"],
f"net_{basename}_{resume_iter}.pth")
logger.info(f"Set {name} to {opt["path"][name]}")