unslothai/unsloth · error · HTTPException

'{entry['repo']}' has no image column to import.

Error message

'{entry['repo']}' has no image column to import.

What it means

HTTP 502 from the HF-dataset import path (_materialize_hf_dataset): the repo loaded (streaming or prepared), its features were known, but _detect_image_column(features) found no column that looks like an image. The upstream curated repo's schema changed (or never had) an image column, so there is nothing to import; the server reports it as an upstream (502) failure rather than a client error.

Source

Thrown at studio/backend/routes/training.py:4102

    """Stream rows from datasets.load_dataset into ``dest`` as numbered images + optional
    .txt sidecars. Returns the number of images written."""
    from datasets import load_dataset

    kwargs = {"split": "train"}
    if entry.get("no_checks"):
        kwargs["verification_mode"] = "no_checks"
    # Stream rather than prepare the whole split: the loop keeps at most `cap` rows while these
    # curated repos run to tens of thousands. A repo that cannot stream falls back to prepared.
    try:
        ds = load_dataset(entry["repo"], streaming = True, **kwargs)
        features = ds.features
    except Exception:  # noqa: BLE001 -- not streamable; the prepared load is the fallback
        ds = load_dataset(entry["repo"], **kwargs)
        features = ds.features
    # Streaming can hand back a dataset whose features are only known once a row is read, so resolve the columns from the first row then.
    image_col = _detect_image_column(features) if features else None
    if image_col is None and features:
        raise HTTPException(
            status_code = 502,
            detail = f"'{entry['repo']}' has no image column to import.",
        )
    caption_col = _detect_caption_column(entry, list(features.keys())) if features else None
    written = 0
    for row in ds:
        if written >= cap:
            break
        if image_col is None:
            image_col = _detect_image_column_from_row(row)
            if image_col is None:
                raise HTTPException(
                    status_code = 502,
                    detail = f"'{entry['repo']}' has no image column to import.",
                )
            caption_col = _detect_caption_column(entry, list(row.keys()))
        img = row[image_col]
        if img is None:

View on GitHub (pinned to 203007d190)

Solutions

  1. Retry after the curated list is updated in Studio (pull latest / update the app) — the fix is on the server's curated entries, not your data.
  2. Verify the repo schema manually: datasets.load_dataset_features(repo) and inspect column types, then report the drift.
  3. Choose a different example dataset that still has an image column.

Example fix

python -c "from datasets import load_dataset_builder; \
  b = load_dataset_builder('username/repo'); print(b.info.features)"
Defensive patterns

Strategy: fallback

Validate before calling

from datasets import load_dataset_builder

def repo_has_image_column(repo: str) -> bool:
    feats = load_dataset_builder(repo).info.features
    return any(getattr(f, '_type', None) == 'Image' for f in (feats or {}).values())

Type guard

def is_no_image_column(exc: HTTPException) -> bool:
    return exc.status_code == 502 and 'no image column' in str(exc.detail)

Try / catch

try:
    await api.importExample(ex.id)
except HTTPStatusError as e:
    if e.response.status_code == 502 and 'no image column' in e.response.text:
        pick_another_example()  # upstream schema drift; not retryable as-is
    else:
        raise

Prevention

When it happens

Trigger: Importing a curated example whose entry['repo'] on Hugging Face changed schema — image column renamed (e.g. 'img' -> 'image'), replaced with a URL string column, or dropped. Fails before any row is read because features already advertise the columns.

Common situations: Upstream HF dataset maintainers renaming columns; curated-list drift in this repo pointing at an old revision; split/config kwargs selecting a subset without the image column.

Related errors


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