unslothai/unsloth · error · ValueError

All {total} samples failed during VLM conversion — no usable

Error message

All {total} samples failed during VLM conversion — no usable images found. This dataset may contain only image URLs that are no longer accessible.

What it means

Raised when VLM conversion finishes with an empty converted_list: every single sample failed to produce a usable image, so there is nothing to train on. The message is enriched with an LLM-generated hint (llm_generate_dataset_warning) when available, otherwise the default text is raised. It explicitly points at unreachable URLs or nonexistent local paths in the image column.

Source

Thrown at studio/backend/utils/datasets/format_conversion.py:692

    if len(converted_list) == 0:
        issues = [
            f"All {total} samples failed during VLM conversion — no usable images found",
            f"Image column '{image_column}' may contain URLs that are no longer accessible, "
            "or local file paths that don't exist",
        ]
        friendly = None
        try:
            from .llm_assist import llm_generate_dataset_warning
            friendly = llm_generate_dataset_warning(
                issues,
                dataset_name = dataset_name,
                modality = "vision",
                column_names = [image_column, text_column],
            )
        except Exception:
            pass
        raise ValueError(
            friendly
            or (
                f"All {total} samples failed during VLM conversion — no usable images found. "
                "This dataset may contain only image URLs that are no longer accessible."
            )
        )

    logger.info(f"✅ Converted {len(converted_list)}/{total} samples")
    _notify(f"Converted {len(converted_list):,}/{total:,} images successfully")

    # Return list, NOT a Dataset
    return converted_list


def convert_sharegpt_with_images_to_vlm_format(
    dataset,
    image_column = "image",
    messages_column = "conversations",

View on GitHub (pinned to 203007d190)

Solutions

  1. Verify the image column actually contains images: inspect a few values (URL or path) and open one manually.
  2. If local paths, check they exist from the backend's working directory and remount/copy the image folder.
  3. If URLs, curl a few to confirm reachability and auth requirements (HF token, cookies).
  4. Re-run conversion with the correct image_column / text_column mapping.
  5. Fall back to a dataset with embedded image bytes.

Example fix

# before
converted = convert_vlm(ds, image_column="caption")  # wrong column -> all fail

# after
converted = convert_vlm(ds, image_column="image_url", text_column="caption")
Defensive patterns

Strategy: validation

Validate before calling

def dataset_has_resolvable_images(ds, image_column, n=5):
    """Check the first n samples resolve to bytes/path/URL before converting."""
    for sample in ds.select(range(min(n, len(ds)))):
        v = sample[image_column]
        ok = (
            isinstance(v, str)
            or (isinstance(v, dict) and ("bytes" in v or "path" in v))
        )
        if not ok:
            return False
    return len(ds) > 0

Type guard

def is_resolvable_image(value) -> bool:
    if isinstance(value, str) and value:
        return True
    if isinstance(value, dict):
        return bool(value.get("bytes") or value.get("path"))
    return False

Try / catch

try:
    converted = convert_vlm(ds, image_column=col)
except ValueError as e:
    if "no usable images found" in str(e):
        raise SystemExit(f"Image column '{col}' unusable; inspect {col} values") from e
    raise

Prevention

When it happens

Trigger: Converting a dataset where 100% of samples fail image resolution: all URLs 404, all local file paths missing, or the image column actually holding non-image data (e.g. captions) so Image.open fails on every row.

Common situations: Dataset moved/renamed so relative local image paths no longer resolve; column misconfiguration (user selected the wrong column as image_column); dataset loaded from a machine where images were on an unmounted drive; all URLs from a dead host.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/5c9ba541e5b541d0. Report an issue: GitHub.