我在windows 10上运行Matlab2017。 我调用了一个python脚本,它在云上运行一些语音识别任务,如下所示:
userAuthCode=1;% authentication code for user account to be run on cloud
cmd = ['C:\Python27\python.exe runASR.py userAuthCode];
system(cmd);
当python的语音识别命令在python控制台上运行时,我可以在上面的音频文件中看到python的声音识别命令。 我想做以下事情:
(1)并行执行多个这样的命令。假设,我有2个输入音频文件(每个文件都有不同的音频段),我想运行上述命令2次,但并行,使用不同的进程。我能够创建一个代码段,它应该能够做到:
^{pr2}$现在,当执行上述代码时,我可以看到数据1的ASRE分数,但不能看到数据2的分数。
变量rc中的退出状态是0,1,,这证实了这一点。
问题是我不知道错误的原因,因为没有打印出来
Matlab。如何从java/Matlab捕获的Python中获取错误消息
让我看一下?在
问题可能是多次调用 ASRE并行(当然有不同的用户帐户)可能不会 支持,但我不知道除非我能看到错误。在
(2)当我独立运行一个命令时,如文章开头所述,我能够看到在Matlab控制台中打印的每个音频段的分数消息,因为它们是从Python获得的。但是,使用java.lang.Runtime运行时.getRuntime()以及相关代码,在Matlab控制台中不显示任何消息。有没有一种方法可以显示这些消息(我假设显示可能是异步的?)在
谢谢
赛迪
一种方法是在Python中使用多处理。结果和任何错误消息都可以在列表中返回。在
示例:
假设您有三个音频文件,
your_function
将并行运行3次,并返回错误消息。在相关问题 更多 >
编程相关推荐