Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using lhotse cut simple to merge unsorted recordings.jsonl.gz and supervisions.jsonl.gz causes segment fault #925

Closed
JinZr opened this issue Dec 12, 2022 · 11 comments

Comments

@JinZr
Copy link
Contributor

JinZr commented Dec 12, 2022

Adding the --force-eager option circumvents the issue, but maybe throwing a warning would be better.

Best
Jin

@JinZr
Copy link
Contributor Author

JinZr commented Dec 12, 2022

Seems like this happens because Lhotse doesn't support <end-time> token in segments to be -1.

@pzelasko
Copy link
Collaborator

pzelasko commented Dec 14, 2022

Adding the --force-eager option circumvents the issue, but maybe throwing a warning would be better.

Yes, a warning would be useful.. Would you mind creating a PR with it?

Seems like this happens because Lhotse doesn't support token in segments to be -1.

What tokens do you mean? The manifests have duration rather than end.

@JinZr
Copy link
Contributor Author

JinZr commented Dec 14, 2022

Yes, I’ll look into that for a PR.

And for the second question, the load_kaldi_data_dir needs a segments file to exist for generating the supervision manifest. kaldi.py

In the segments file, each item follows the following format: speaker_name wavfilename start_time(in secs) end_time(in secs) channel-id(0 or 1), where the end_time token can be set to -1 to represent "reading to the end of the wavfile".

@pzelasko
Copy link
Collaborator

Hmm I didn’t know segments can have -1. A support for that would need to be added in load Kaldi data dir. can you also add this? Thanks!

@JinZr
Copy link
Contributor Author

JinZr commented Dec 15, 2022

I think end_time holding -1 is a rare case extract-segments.cc, I'll make it a PR later, thanks for responding!

@kfmn
Copy link

kfmn commented Dec 19, 2022

Hi all,

I have the similar situation.
I need to create CutSet from my Kaldi data folder. And I would like to use my precomputed features via feats.scp
My data has segments file, so single recording may contain several supervisions.

I have imported kaldi data folder into {recordings, supervisions, features}.jsonl.gz with lhotse cut import
Then I wanted to obtain CutSet from recordings and supervisions only with lhotse cut simple. On this stage I also had Segmentation Fault caused by inconsistent sorting but --force-eager helped me to overcome this issue.
Then I made lhotse cut trim-to-supervisions to obtain single supervision per cut, and decomposed the CutSet back with lhotse decompose.

After decomposing I added features.jsonl.gz to make CutSet once again. Without --force-eager I have an exception like this:
AssertionError: Mismatched recording_id: Features.recording_id == 00541_inline1_landline, but Recording.id == '00541_inline1_mobile' which seems to be caused by inconsistent sorting too.
With --force-eager all goes well but supervisions in obtained CutSet turn to be empty! What do I do wrongly?

Could you please provide a minimal lhotse recipe on how to prepare CutSet in settings like my?

@pzelasko
Copy link
Collaborator

pzelasko commented Jan 2, 2023

@kfmn you can use features.scp directly in lhotse kaldi import if you provide the frame shift (I think via -f option). You wouldn't need to decompose anything etc, it should just work. LMK how it went.

@kfmn
Copy link

kfmn commented Jan 16, 2023

@kfmn you can use features.scp directly in lhotse kaldi import if you provide the frame shift (I think via -f option). You wouldn't need to decompose anything etc, it should just work. LMK how it went.

I used --frame-shift (same as -f) option, so it doesn't solve my issue

@pzelasko
Copy link
Collaborator

In that case, can you use lhotse cut simple with all three of recordings, supervisions, and features? Then trim-to-supervisions will correctly trim the features as well.

@JinZr
Copy link
Contributor Author

JinZr commented Jan 20, 2023 via email

@desh2608
Copy link
Collaborator

desh2608 commented Feb 7, 2023

Closing via #952.

@desh2608 desh2608 closed this as completed Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants