{"record":{"id":"7e7f7003c20b2e74","repo":"tensorflow/models","slug":"steps-steps-should-be-0-or-1","errorCode":null,"errorMessage":"`steps` ({steps}) should be > 0, or == -1.","messagePattern":"`steps` \\((.+?)\\) should be > 0, or == -1\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"orbit/controller.py","lineNumber":318,"sourceCode":"        until the underlying dataset is exhausted. Support for this is dependent\n        on the specific `evaluator` being used.\n\n    Returns:\n      The evaluation results as a dictionary mapping names to NumPy values.\n\n    Raises:\n      ValueError: If `evaluator` was not provided to `Controller.__init__`.\n      ValueError: If no checkpoint is present in `checkpoint_manager.directory`.\n      ValueError: If `steps` is not a positive value or -1.\n    \"\"\"\n    self._require(\"evaluator\", for_method=\"evaluate\")\n\n    if steps > 0:\n      steps_msg = f\"running {steps} steps of evaluation...\"\n    elif steps == -1:\n      steps_msg = \"running complete evaluation...\"\n    else:\n      raise ValueError(f\"`steps` ({steps}) should be > 0, or == -1.\")\n\n    current_step = self.global_step.numpy()\n    _log(f\" eval | step: {current_step: 6d} | {steps_msg}\")\n\n    start = time.time()\n    assert isinstance(self.evaluator, runner.AbstractEvaluator)\n    with self.eval_summary_manager.summary_writer().as_default():\n      steps_tensor = tf.convert_to_tensor(steps, dtype=tf.int32)\n      eval_output = self.evaluator.evaluate(steps_tensor)\n    elapsed = time.time() - start\n\n    eval_output = eval_output or {}\n    for action in self.eval_actions:\n      action(eval_output)\n    eval_output = tf.nest.map_structure(utils.get_value, eval_output)\n\n    if steps > 0:\n      # Only log if steps has been specified.","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/orbit/controller.py#L300-L336","documentation":"Error \"`steps` ({steps}) should be > 0, or == -1.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at orbit/controller.py:318 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass steps > 0, or -1 to run until the dataset is exhausted.","Fix the steps argument passed to train/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"}