{"record":{"id":"3008307999653f9e","repo":"tensorflow/models","slug":"steps-per-loop-steps-per-loop-must-be-a-posi","errorCode":null,"errorMessage":"`steps_per_loop` ({steps_per_loop}) must be a positive integer or a callable.","messagePattern":"`steps_per_loop` \\((.+?)\\) must be a positive integer or a callable\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"orbit/controller.py","lineNumber":191,"sourceCode":"        will be created internally for TensorBoard summaries by default from the\n        `eval_summary_dir`.\n\n    Raises:\n      ValueError: If both `trainer` and `evaluator` are `None`.\n      ValueError: If `steps_per_loop` is not a positive integer or a callable.\n      ValueError: If `summary_interval` is not a positive integer or is not\n        divisible by `steps_per_loop`.\n    \"\"\"\n    if trainer is None and evaluator is None:\n      raise ValueError(\"`trainer` and `evaluator` should not both be `None`.\")\n\n    if trainer is not None:\n      if steps_per_loop is None:\n        raise ValueError(\n            \"`steps_per_loop` is required when `trainer` is provided.\")\n      elif not callable(steps_per_loop) and (\n          not isinstance(steps_per_loop, int) or steps_per_loop < 1):\n        raise ValueError(\n            f\"`steps_per_loop` ({steps_per_loop}) must be a positive integer \"\n            \"or a callable.\")\n\n      if summary_interval is not None:\n        if summary_interval <= 0:\n          raise ValueError(\n              f\"`summary_interval` ({summary_interval}) must be larger than 0.\")\n        elif not callable(steps_per_loop) and (summary_interval % steps_per_loop\n                                               != 0):\n          raise ValueError(\n              f\"`summary interval` ({summary_interval}) must be a multiple \"\n              f\"of `steps_per_loop` ({steps_per_loop}).\")\n\n    if not isinstance(global_step, tf.Variable):\n      raise ValueError(\"`global_step` must be a `tf.Variable`.\")\n\n    self.trainer = trainer\n    self.evaluator = evaluator","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/orbit/controller.py#L173-L209","documentation":"Error \"`steps_per_loop` ({steps_per_loop}) must be a positive integer or a callable.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at orbit/controller.py:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set steps_per_loop to a positive integer or a callable returning one.","Fix the steps_per_loop value in the controller config."],"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"}