tensorflow/models · error · ValueError

ensure_directories_exist received an empty path or the curre

Error message

ensure_directories_exist received an empty path or the current working directory ('.'); this usually indicates a configuration error.

What it means

Error "ensure_directories_exist received an empty path or the current working directory ('.'); this usually indicates a configuration error." thrown in tensorflow/models.

Source

Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/image_ops.py:93

    bgr_resized = bgr_image
  rgb_resized = cv2.cvtColor(bgr_resized, cv2.COLOR_BGR2RGB)
  return Image.fromarray(rgb_resized)


def ensure_directories_exist(directories: Sequence[pathlib.Path]) -> None:
  """Creates each directory in the given sequence if it does not already exist.

  Args:
    directories: Paths to create. Each path must be non-empty and not point to
      the current working directory (`.`).

  Raises:
    ValueError: If any path evaluates to `.` (e.g., from `pathlib.Path("")`) or
      is empty (indicates a configuration bug).
  """
  for directory in directories:
    if directory == pathlib.Path("."):
      raise ValueError(
          "ensure_directories_exist received an empty path or the current "
          "working directory ('.'); this usually indicates a configuration "
          "error."
      )
    directory.mkdir(parents=True, exist_ok=True)


def release_caches() -> None:
  """Runs Python garbage collection and empties the CUDA allocator cache.

  Intended to be called between subfolders in a long pipeline run to release
  RAM and VRAM held by unreferenced objects and cached allocations. This does
  not free memory held by live references.
  """
  gc.collect()
  if torch.cuda.is_available():
    torch.cuda.empty_cache()

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/4733b1be85c833b0. Report an issue: GitHub.