Skip to content

使用音频算子报错:ImportError: cannot import name 'AudioDecoder' from 'torchcodec.decoders' (/usr/local/lib/python3.10/dist-packages/torchcodec/decoders/__init__.py) #845

@Young-zj

Description

@Young-zj

Before Asking 在提问之前

  • I have read the README carefully. 我已经仔细阅读了 README 上的操作指引。

  • I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking 先搜索,再提问

  • I have searched the Data-Juicer issues and found no similar questions. 我已经在 issue列表 中搜索但是没有发现类似的问题。

Question

我在使用 audio 系列算子(audio_duration_filter, audio_add_gaussian_noise_mapper, audio_nmf_snr_filter 等)时,遇到持续可复现的导入错误:

ImportError: cannot import name 'AudioDecoder' from 'torchcodec.decoders'

报错堆栈来自内部的:

datasets.features.audio.Audio.encode_example
→ from torchcodec.decoders import AudioDecoder

但是我已经下载了正确版本的 torchcodec ,还是报这个错误,这些audio有什么其他运行条件吗?

Additional 额外信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions