{"record":{"id":"3af205adec35501e","repo":"tensorflow/models","slug":"stateful-eval-loop-is-not-supported-in-async-train","errorCode":null,"errorMessage":"Stateful eval loop is not supported in async training.","messagePattern":"Stateful eval loop is not supported in async training\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/core/base_trainer.py","lineNumber":84,"sourceCode":"    train_loop_fn = super().create_train_loop_fn()\n    if getattr(self, \"_is_async\", False):\n\n      def _async_loop_fn(iterator, num_steps):\n        self.coordinator_for_async().schedule(\n            train_loop_fn, args=(iterator, num_steps)\n        )\n\n      return _async_loop_fn\n    else:\n      return train_loop_fn\n\n  def create_eval_loop_fn(self, has_state: bool):\n    \"\"\"Creates a training loop from the given step function and options.\"\"\"\n    eval_loop_fn = super().create_eval_loop_fn(has_state)\n\n    if getattr(self, \"_is_async\", False):\n      if has_state:\n        raise ValueError(\n            \"Stateful eval loop is not supported in async training.\")\n\n      def _async_loop_fn(iterator, num_steps, state=None, reduce_fn=None):\n        assert state is None\n        assert reduce_fn is None\n        self.coordinator_for_async().schedule(\n            eval_loop_fn, args=(iterator, num_steps)\n        )\n\n      return _async_loop_fn\n    else:\n      return eval_loop_fn\n\n  def distribute_dataset(self, dataset_or_fn, *args, **kwargs):\n    \"\"\"A utility function to help create a `tf.distribute.DistributedDataset`.\n\n    Args:\n      dataset_or_fn: A instance of `tf.data.Dataset`, or a \"dataset function\"","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/base_trainer.py#L66-L102","documentation":"Error \"Stateful eval loop is not supported in async training.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/base_trainer.py:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}