{"record":{"id":"f4437f9797cf4d9f","repo":"microsoft/qlib","slug":"unknown-base-model-name-s-f4437f","errorCode":null,"errorMessage":"unknown base model name `%s`","messagePattern":"unknown base model name `(.+?)`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/contrib/model/pytorch_igmtf.py","lineNumber":279,"sourceCode":"\n        x_train, y_train = df_train[\"feature\"], df_train[\"label\"]\n        x_valid, y_valid = df_valid[\"feature\"], df_valid[\"label\"]\n\n        save_path = get_or_create_path(save_path)\n        stop_steps = 0\n        train_loss = 0\n        best_score = -np.inf\n        best_epoch = 0\n        evals_result[\"train\"] = []\n        evals_result[\"valid\"] = []\n\n        # load pretrained base_model\n        if self.base_model == \"LSTM\":\n            pretrained_model = LSTMModel()\n        elif self.base_model == \"GRU\":\n            pretrained_model = GRUModel()\n        else:\n            raise ValueError(\"unknown base model name `%s`\" % self.base_model)\n\n        if self.model_path is not None:\n            self.logger.info(\"Loading pretrained model...\")\n            pretrained_model.load_state_dict(torch.load(self.model_path, map_location=self.device))\n\n        model_dict = self.igmtf_model.state_dict()\n        pretrained_dict = {\n            k: v for k, v in pretrained_model.state_dict().items() if k in model_dict  # pylint: disable=E1135\n        }\n        model_dict.update(pretrained_dict)\n        self.igmtf_model.load_state_dict(model_dict)\n        self.logger.info(\"Loading pretrained model Done...\")\n\n        # train\n        self.logger.info(\"training...\")\n        self.fitted = True\n\n        for step in range(self.n_epochs):","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/contrib/model/pytorch_igmtf.py#L261-L297","documentation":"Like HISTModel, IGMTFModel.fit builds a pretrained base model from self.base_model and only 'LSTM' and 'GRU' are recognized. Any other string raises ValueError before the training loop starts, because weight transfer into the IGMTF graph depends on one of those two architectures.","triggerScenarios":"Constructing IGMTFModel(base_model='Transformer') or any string other than 'LSTM'/'GRU' (case-sensitive), then calling fit().","commonSituations":"Config copied from a Transformer-family model; lowercase 'lstm'; typo in the YAML kwargs.","solutions":["Set base_model='LSTM' or base_model='GRU' exactly","Check task -> model -> kwargs -> base_model in workflow YAML"],"exampleFix":"# before\nIGMTFModel(base_model=\"lstm\")\n\n# after\nIGMTFModel(base_model=\"LSTM\")","handlingStrategy":"validation","validationCode":"assert model.base_model in (\"LSTM\", \"GRU\"), \"IGMTFModel base_model must be LSTM or GRU\"","typeGuard":"def is_valid_base_model(name: str) -> bool:\n    return name in (\"LSTM\", \"GRU\")","tryCatchPattern":null,"preventionTips":["Validate base_model when parsing workflow configs","Avoid sharing one kwargs dict across HIST/IGMTF/Transformer models"],"tags":["qlib","igmtf","invalid-argument","config"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}