huggingface
data_error
ai_generated
true
IndexError: 处理数据集 'my_dataset' 的分片 4 时列表索引超出范围
IndexError: list index out of range while processing shard 4 of dataset 'my_dataset'
ID: huggingface/dataset-sharding-index-out-of-range
88%修复率
85%置信度
1证据数
2024-03-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| huggingface/datasets 2.18.0 | active | — | — | — |
| huggingface/datasets 2.19.0 | active | — | — | — |
| huggingface/datasets 2.20.0 | active | — | — | — |
根因分析
数据集分片文件损坏或不完整,导致分片时实际样本数少于预期。
English
Dataset shard file is corrupted or incomplete, causing fewer examples than expected when splitting into shards.
官方文档
https://huggingface.co/docs/datasets/en/loading#sharding解决方案
-
Clear the dataset cache and re-download: `import datasets; datasets.load_dataset('my_dataset', cache_dir='/tmp/fresh_cache')` -
Manually verify shard files: `ls ~/.cache/huggingface/datasets/my_dataset/*.arrow` and remove any zero-byte files before re-loading.
无效尝试
常见但无效的做法:
-
Increase shard count to reduce per-shard size
75% 失败
The error is due to a corrupted shard file, not shard size. Changing shard count doesn't fix the underlying data corruption.
-
Re-download the entire dataset without checking shard integrity
60% 失败
If the cache is corrupt, simply re-downloading without clearing the cache may reuse the same corrupted file.