{"record":{"id":"4733b1be85c833b0","repo":"tensorflow/models","slug":"ensure-directories-exist-received-an-empty-path-or","errorCode":null,"errorMessage":"ensure_directories_exist received an empty path or the current working directory ('.'); this usually indicates a configuration error.","messagePattern":"ensure_directories_exist received an empty path or the current working directory \\('\\.'\\); this usually indicates a configuration error\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/image_ops.py","lineNumber":93,"sourceCode":"    bgr_resized = bgr_image\n  rgb_resized = cv2.cvtColor(bgr_resized, cv2.COLOR_BGR2RGB)\n  return Image.fromarray(rgb_resized)\n\n\ndef ensure_directories_exist(directories: Sequence[pathlib.Path]) -> None:\n  \"\"\"Creates each directory in the given sequence if it does not already exist.\n\n  Args:\n    directories: Paths to create. Each path must be non-empty and not point to\n      the current working directory (`.`).\n\n  Raises:\n    ValueError: If any path evaluates to `.` (e.g., from `pathlib.Path(\"\")`) or\n      is empty (indicates a configuration bug).\n  \"\"\"\n  for directory in directories:\n    if directory == pathlib.Path(\".\"):\n      raise ValueError(\n          \"ensure_directories_exist received an empty path or the current \"\n          \"working directory ('.'); this usually indicates a configuration \"\n          \"error.\"\n      )\n    directory.mkdir(parents=True, exist_ok=True)\n\n\ndef release_caches() -> None:\n  \"\"\"Runs Python garbage collection and empties the CUDA allocator cache.\n\n  Intended to be called between subfolders in a long pipeline run to release\n  RAM and VRAM held by unreferenced objects and cached allocations. This does\n  not free memory held by live references.\n  \"\"\"\n  gc.collect()\n  if torch.cuda.is_available():\n    torch.cuda.empty_cache()\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/image_ops.py#L75-L111","documentation":"Error \"ensure_directories_exist received an empty path or the current working directory ('.'); this usually indicates a configuration error.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/image_ops.py:93 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"}