lhotse-speech / lhotse

Tools for handling speech data in machine learning projects.
https://lhotse.readthedocs.io/en/latest/
Apache License 2.0
908 stars 205 forks source link

Updating lhotse caused some errors when reading data #1227

Open lucy9527 opened 7 months ago

lucy9527 commented 7 months ago

error

    data = fetcher.fetch(index)
  File "/anaconda3/envs/k2/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 53, in fetch
    data = self.dataset[possibly_batched_index]
  File "/anaconda3/envs/k2/lib/python3.8/site-packages/lhotse/dataset/speech_recognition.py", line 116, in __getitem__
    input_tpl = self.input_strategy(cuts)
  File "/anaconda3/envs/k2/lib/python3.8/site-packages/lhotse/dataset/input_strategies.py", line 120, in __call__
    return collate_features(
  File "/anaconda3/envs/k2/lib/python3.8/site-packages/lhotse/dataset/collation.py", line 129, in collate_features
    assert all(cut.has_features for cut in cuts)
AssertionError

My setting

lhotse 1.16.0

{"id": "1789427dfeafd27d67b8c90e64114779-20064", "start": 0, "duration": 3.26, "channel": 0, "supervisions": [{"id": "1789427dfeafd27d67b8c90e64114779", "recording_id": "1789427dfeafd27d67b8c90e64114779", "start": 0.0, "duration": 3.26, "channel": 0, "text": "你是
不是 要把 李 璋 治 捉 去", "language": "Chinese", "speaker": "1789427dfeafd27d67b8c90e64114779"}], "recording": {"id": "1789427dfeafd27d67b8c90e64114779", "sources": [{"type": "file", "channels": [0], "source": "/wav/1789427dfeafd27d67b8c90e64114779.wav"}], "sampling_rate": 16000, "num_samples": 52160, "duration": 3.26, "channel_ids": [0]}, "type": "MonoCut"}
pzelasko commented 7 months ago

You’re trying to read precomputed features from cuts that don’t have them. Are you sure you got the right cut set?

lucy9527 commented 7 months ago

You’re trying to read precomputed features from cuts that don’t have them. Are you sure you got the right cut set?

Yes, the default value for "--input-strategy" is "PrecomputedFeatures". Changing it to "AudioSamples" resolved the issue.