{"record":{"id":"594da12a2a892dd7","repo":"tensorflow/models","slug":"model-dir-must-be-set","errorCode":null,"errorMessage":"model_dir must be set.","messagePattern":"model_dir must be set\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/executor/distributed_executor.py","lineNumber":616,"sourceCode":"      model_dir: the folder for storing model checkpoints.\n      eval_input_fn: (Optional) same type as train_input_fn. If not None, will\n        trigger evaluting metric on eval data. If None, will not run eval step.\n      eval_metric_fn: metric_fn for evaluation in test_step.\n      total_steps: total training steps. If the current step reaches the\n        total_steps, the evaluation loop will stop.\n      eval_timeout: The maximum number of seconds to wait between checkpoints.\n        If left as None, then the process will wait indefinitely. Used by\n        tf.train.checkpoints_iterator.\n      min_eval_interval: The minimum number of seconds between yielding\n        checkpoints. Used by tf.train.checkpoints_iterator.\n      summary_writer_fn: function to create summary writer.\n\n    Returns:\n      Eval metrics dictionary of the last checkpoint.\n    \"\"\"\n\n    if not model_dir:\n      raise ValueError('model_dir must be set.')\n\n    def terminate_eval():\n      tf.logging.info('Terminating eval after %d seconds of no checkpoints' %\n                      eval_timeout)\n      return True\n\n    summary_writer = summary_writer_fn(model_dir, 'eval')\n    self.eval_summary_writer = summary_writer.writer\n\n    # Read checkpoints from the given model directory\n    # until `eval_timeout` seconds elapses.\n    for checkpoint_path in tf.train.checkpoints_iterator(\n        model_dir,\n        min_interval_secs=min_eval_interval,\n        timeout=eval_timeout,\n        timeout_fn=terminate_eval):\n      eval_metric_result, current_step = self.evaluate_checkpoint(\n          checkpoint_path=checkpoint_path,","sourceCodeStart":598,"sourceCodeEnd":634,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/executor/distributed_executor.py#L598-L634","documentation":"Error \"model_dir must be set.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/executor/distributed_executor.py:616 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"}