Repository navigation
Advance past invalid MMSeg samples - #3194
dajiaohuang wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
khustup2
left a comment
There was a problem hiding this comment.
The retry logic reads correctly. Before merge:
- Give a reproduction: a dataset whose first sample is invalid, and the old code looping forever.
- What happens when every sample is invalid? With the new code
idxgrows past len(self) and the next access raises IndexError inside the loop. Bound the loop and raise a clear error. - Replace the ast/exec test with a test that imports the module normally.
|
Bounded retries to one attempt per dataset row, retained preference for a known successful fallback, and continued when that fallback also becomes invalid. All-invalid exhaustion now raises a clear The regression tests now normally import the complete source module. All 10 focused cases pass, including actual source exception types for invalid images and segments. The previous head fails 7 of these cases. Black and diff checks pass. Actual PyTorch/NumPy and source helpers are used; unavailable MMSeg/MMCV/native bootstrap dependencies are isolated, so a full training integration pass is not claimed. |
khustup2
left a comment
There was a problem hiding this comment.
All three points are addressed: retries are bounded to one attempt per row, exhaustion raises a clear RuntimeError, out-of-range input stays an IndexError, and the tests import the real module with the unavailable MM dependencies stubbed. Treating a pipeline None as a rejection matches mmdet's own CustomDataset convention.
Fixes #3193.
Invalid-image/segment retries now try each dataset index at most once per request. The known successful sample is still preferred, but if it has become invalid, retry continues through the remaining rows. Complete exhaustion raises a clear
RuntimeError, and pipelineNoneis rejection rather than success. Empty/out-of-range requests raiseIndexError; valid negative indices are normalized.Tests normally import the full
deeplake.integrations.mmseg.mmseg_dataset_source module, using actual PyTorch/NumPy and source-tree exception/array helpers. Unavailable MMSeg/MMCV/prettytable and the native package bootstrap are explicitly isolated. This verifies the real wrapper's behavior without claiming a full framework training run.Validation:
git diff --checkpass.fcntlon Windows; no target plugin was bypassed for these focused tests.