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

AttributeError: 'dict' object has no attribute 'to_dict' #1351

Open
lalimili6 opened this issue Jun 8, 2024 · 2 comments
Open

AttributeError: 'dict' object has no attribute 'to_dict' #1351

lalimili6 opened this issue Jun 8, 2024 · 2 comments

Comments

@lalimili6
Copy link

I installed this version lhotse-1.24.0.dev0+git.4d57d53.clean and used this script to fbank compute egs/commonvoice/ASR/local/compute_fbank_commonvoice_dev_test.py
get this error how can fix it?
best regards

./local/compute_fbank_commonvoice_dev_test.py --language $lang                                                              ─╯
    touch data/${lang}/fbank/.cv-${lang}_dev_test.done
2024-06-08 23:20:07,362 INFO [compute_fbank_commonvoice_dev_test.py:106] {'language': 'fa'}
2024-06-08 23:20:09,786 INFO [compute_fbank_commonvoice_dev_test.py:69] device: cuda:0
2024-06-08 23:20:09,786 INFO [compute_fbank_commonvoice_dev_test.py:79] Loading data/fa/fbank/cv-fa_cuts_dev_raw.jsonl.gz
2024-06-08 23:20:09,851 INFO [compute_fbank_commonvoice_dev_test.py:82] Splitting cuts into smaller chunks
2024-06-08 23:20:09,851 INFO [compute_fbank_commonvoice_dev_test.py:87] Computing features
Computing features in batches: 3it [00:02,  1.22it/s]
2024-06-08 23:20:12,312 INFO [compute_fbank_commonvoice_dev_test.py:97] Saving to data/fa/fbank/cv-fa_cuts_dev.jsonl.gz
Traceback (most recent call last):
  File "/home/yamahdi/Documents/icefall/egs/commonvoice/ASR_1/./local/compute_fbank_commonvoice_dev_test.py", line 107, in <module>
    compute_fbank_commonvoice_dev_test(language=args.language)
  File "/home/yamahdi/Documents/icefall/egs/commonvoice/ASR_1/./local/compute_fbank_commonvoice_dev_test.py", line 98, in compute_fbank_commonvoice_dev_test
    cut_set.to_file(cuts_path)
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/serialization.py", line 532, in to_file
    store_manifest(self, path)
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/serialization.py", line 517, in store_manifest
    manifest.to_jsonl(path)
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/serialization.py", line 300, in to_jsonl
    save_to_jsonl(self.to_dicts(), path)
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/serialization.py", line 125, in save_to_jsonl
    for item in data:
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/cut/set.py", line 688, in <genexpr>
    return (cut.to_dict() for cut in self)
            ^^^^^^^^^^^^^
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/cut/data.py", line 77, in to_dict
    d["recording"] = self.recording.to_dict()
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/audio/recording.py", line 339, in to_dict
    d["transforms"] = [t.to_dict() for t in self.transforms]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamahdi/Documents/icefall/env/lib/python3.11/site-packages/lhotse/audio/recording.py", line 339, in <listcomp>
    d["transforms"] = [t.to_dict() for t in self.transforms]
                       ^^^^^^^^^
AttributeError: 'dict' object has no attribute 'to_dict'

@pzelasko
Copy link
Collaborator

Could you try with #1355?

@zyw241
Copy link

zyw241 commented Jul 1, 2024

update lhotse to the latest version(now 1.25.0)

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

3 participants