{"record":{"id":"914af1ba44620637","repo":"tensorflow/models","slug":"attribute-is-not-set-pass-attribute-to-c","errorCode":null,"errorMessage":"`{attribute}` is not set. Pass `{attribute}` to `Controller.__init__` before calling `{for_method}()`.","messagePattern":"`(.+?)` is not set\\. Pass `(.+?)` to `Controller\\.__init__` before calling `(.+?)\\(\\)`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"orbit/controller.py","lineNumber":572,"sourceCode":"        was provided to `Controller.__init__`.\n\n    Returns:\n      A boolean indicating whether a checkpoint was saved.\n    \"\"\"\n    if self.checkpoint_manager and self.checkpoint_manager.checkpoint_interval:\n      ckpt_path = self.checkpoint_manager.save(\n          checkpoint_number=self.global_step.numpy(),\n          check_interval=check_interval,\n          options=self._checkpoint_options)\n      if ckpt_path is not None:\n        _log(f\"saved checkpoint to {ckpt_path}.\")\n        return True\n    return False\n\n  def _require(self, attribute, for_method):\n    \"\"\"Utility method to raise an error if the given `attribute` is not set.\"\"\"\n    if getattr(self, attribute, None) is None:\n      raise ValueError(\n          f\"`{attribute}` is not set. Pass `{attribute}` to \"\n          f\"`Controller.__init__` before calling `{for_method}()`.\")\n\n  def _sync_on_async_checkpointing(self):\n    \"\"\"Force to wait for the async checkpoint saving (if any) to finish.\"\"\"\n    # pylint: disable=protected-access\n    if self.checkpoint_manager:\n      logging.info(\"Sync on async checkpoint saving.\")\n      self.checkpoint_manager.sync()\n\n\nclass StepTimer:\n  \"\"\"Utility class for measuring steps/second.\"\"\"\n\n  def __init__(self, step):\n    self.step = step\n    self.start()\n","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/orbit/controller.py#L554-L590","documentation":"Error \"`{attribute}` is not set. Pass `{attribute}` to `Controller.__init__` before calling `{for_method}()`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at orbit/controller.py:572 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the named attribute to Controller.__init__ before calling the method.","Call the method that matches the components you provided (train vs evaluate)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}