{"record":{"id":"dac26e01fc311d77","repo":"tensorflow/models","slug":"smart-bias-is-only-supported-currently-with-alinea","errorCode":null,"errorMessage":"Smart Bias is only supported currently with alinear warm up.","messagePattern":"Smart Bias is only supported currently with alinear warm up\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/yolo/optimization/optimizer_factory.py","lineNumber":86,"sourceCode":"    Builds learning rate from config. Learning rate schedule is built according\n    to the learning rate config. If learning rate type is consant,\n    lr_config.learning_rate is returned.\n\n    Args:\n      bias_lr: learning rate config.\n\n    Returns:\n      tf_keras.optimizers.schedules.LearningRateSchedule instance. If\n      learning rate type is consant, lr_config.learning_rate is returned.\n    \"\"\"\n    if self._lr_type == 'constant':\n      lr = self._lr_config.learning_rate\n    else:\n      lr = LR_CLS[self._lr_type](**self._lr_config.as_dict())\n\n    if self._warmup_config:\n      if self._warmup_type != 'linear':\n        raise ValueError('Smart Bias is only supported currently with a'\n                         'linear warm up.')\n      warm_up_cfg = self._warmup_config.as_dict()\n      warm_up_cfg['warmup_learning_rate'] = bias_lr\n      lr = WARMUP_CLS['linear'](lr, **warm_up_cfg)\n    return lr\n\n  @gin.configurable\n  def add_ema(self, optimizer):\n    \"\"\"Add EMA to the optimizer independently of the build optimizer method.\"\"\"\n    if self._use_ema:\n      optimizer = ema_optimizer.ExponentialMovingAverage(\n          optimizer, **self._ema_config.as_dict())\n    return optimizer\n","sourceCodeStart":68,"sourceCodeEnd":100,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/yolo/optimization/optimizer_factory.py#L68-L100","documentation":"Compatibility guard in OptimizerFactory.get_bias_lr_schedule: smart-bias learning-rate scaling is configured, but the warmup schedule is not linear. The smart-bias implementation only knows how to adjust bias LRs relative to a linear warmup curve; with any other warmup the bias schedule math is undefined, so the factory refuses rather than emitting a wrong schedule.","triggerScenarios":"Thrown at official/projects/yolo/optimization/optimizer_factory.py:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the warmup type to 'linear' in the optimizer config when smart bias is enabled","Disable smart bias if a non-linear warmup is required","Check the warmup config fields (type/name) for typos that fall into the non-linear branch"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}