Kaldi的Python3库附加

本文介绍了如何将Kaldi的Python3库添加到Python3环境中,以方便Kaldi的chain和nnet3模型训练过程的观察、定位和调试。主要涉及`wsj/s5/steps/libs`目录下的Python文件,特别是`common.py`中的关键函数,以及在Windows 10上配置库路径的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

为了更为方便观察Kaldi整个训练过程,需要将Kaldi写的Python3库附加到Python3的系统库中,方便定为和调试。

1 wsj/s5/steps/libs目录

该目录下的python文件均是kaldi训练chain和nnet3训练模型的主程序,通过这些python程序,带上合适参数,去调用shell的命令行(说是python,其实里面还是调用shell命令行去训练的)
在这里插入图片描述
重点分析一下common.py里面的最常用的几个函数:
【execute_command】前台运行一个shell命令行,若返回不是0,则报错

def execute_command(command):
    """ Runs a kaldi job in the foreground and waits for it to complete; raises an
        exception if its return status is nonzero.  The command is executed in
        'shell' mode so 'command' can involve things like pipes.  Often,
        'command' will start with 'run.pl' or 'queue.pl'.  The stdout and stderr
        are merged with the calling process's stdout and stderr so they will
  
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值