{"record":{"id":"2c56895c7797fcf9","repo":"tensorflow/models","slug":"coordinator-uninitialized-for-async-run-call-init","errorCode":null,"errorMessage":"Coordinator uninitialized for async run. Call init_async() first.","messagePattern":"Coordinator uninitialized for async run\\. Call init_async\\(\\) first\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/core/base_trainer.py","lineNumber":54,"sourceCode":"class _AsyncTrainer(orbit.StandardTrainer, orbit.StandardEvaluator):\n  \"\"\"Trainer class for both sync and async Strategy.\"\"\"\n\n  def init_async(self):\n    \"\"\"Initializes the Async Trainer base class.\"\"\"\n    assert isinstance(self._strategy, tf.distribute.Strategy)\n    self._is_async = isinstance(\n        self._strategy, tf.distribute.experimental.ParameterServerStrategy)\n    self._coordinator = None\n    if self._is_async:\n      self._coordinator = (\n          tf.distribute.experimental.coordinator.ClusterCoordinator(\n              self._strategy))\n\n  def coordinator_for_async(\n      self,\n  ) -> tf.distribute.experimental.coordinator.ClusterCoordinator:\n    if not self._coordinator:\n      raise ValueError(\n          \"Coordinator uninitialized for async run. Call init_async() first.\"\n      )\n    return self._coordinator\n\n  def join(self):\n    \"\"\"Join all async steps. Only useful in aysnc training.\"\"\"\n    if getattr(self, \"_is_async\", False):\n      self.coordinator_for_async().join()\n\n  def create_train_loop_fn(self):\n    \"\"\"Creates a eval loop from the given step function and options.\"\"\"\n    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        )","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/base_trainer.py#L36-L72","documentation":"Error \"Coordinator uninitialized for async run. Call init_async() first.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/base_trainer.py:54 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"}