AttributeError: ‘NoneType‘ object has no attribute ‘crop‘

10 篇文章 8 订阅 ¥19.90 ¥99.00
5 篇文章 0 订阅
在使用Pyannote.Audio库时遇到'NoneType'对象没有'crop'属性的错误。问题根源在于文件'/python/site-packages/pyannote/database/util.py'中,对'annotated'键的检查不充分。解决方案是确保在database.py中的'annotation'路径正确,或者在未经注释的文件中注释掉相应部分。
摘要由CSDN通过智能技术生成

File “/python/site-packages/pyannote/audio/labeling/tasks/base.py”, line 301, in _load_metadata
current_file[“annotated”] = get_annotated(current_file).crop(
AttributeError: ‘NoneType’ object has no attribute ‘crop’
这个问题终于完美解决

找到这个文件

/pyannote/database/util.py

其中:

# if protocol provides 'annotated' key, use it
if "annotated" in current_file:
    annotated = current_file["annotated"]
    return annotated


# if it does not, but does provide 'audio' key
# try and use wav duration
if "duration" in current_file:
    try:
        duration = current_file["duration"]
    except ImportError:
        pass
    else:
        annotated = Timeline([Segment(0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

齐天大疯子

为别人的付出付费,必将轮回自己

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值