mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-24 21:19:53 +00:00
log(annotate): warn loudly on first video decode failure
VideoFrameProvider._decode used to swallow every exception silently and return []. That made Module 3 (VQA) produce zero rows whenever local video decoding broke (codec, backend, missing file, ...) because every prompt got skipped via the ``not _has_image_block(messages)`` branch in general_vqa.py — without any signal in the job log. Log the first failure with full exception info (subsequent failures stay quiet to avoid log spam) so this fast-path is debuggable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -208,7 +208,25 @@ class VideoFrameProvider:
|
|||||||
backend=backend,
|
backend=backend,
|
||||||
return_uint8=True,
|
return_uint8=True,
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
|
# Log loudly the first time decoding fails so silent
|
||||||
|
# Module-3-no-op (every prompt skipped because frames_at returned
|
||||||
|
# []) is debuggable from the job log instead of post-hoc parquet
|
||||||
|
# inspection. Subsequent failures stay quiet.
|
||||||
|
if not getattr(self, "_warned_decode_fail", False):
|
||||||
|
import logging # noqa: PLC0415
|
||||||
|
|
||||||
|
logging.getLogger(__name__).warning(
|
||||||
|
"VideoFrameProvider._decode failed for episode=%s camera=%s "
|
||||||
|
"video_path=%s backend=%s: %s",
|
||||||
|
episode_index,
|
||||||
|
camera_key,
|
||||||
|
video_path,
|
||||||
|
backend,
|
||||||
|
exc,
|
||||||
|
exc_info=True,
|
||||||
|
)
|
||||||
|
self._warned_decode_fail = True
|
||||||
return []
|
return []
|
||||||
# frames: [N, C, H, W] uint8, RGB
|
# frames: [N, C, H, W] uint8, RGB
|
||||||
out: list[Any] = []
|
out: list[Any] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user