I am running Matlab2017 on windows 10. I call a python script that runs some Speech Recognition task on cloud with something like this:
userAuthCode=1;% authentication code for user account to be run on cloud
cmd = ['C:\Python27\python.exe runASR.py userAuthCode];
system(cmd);
When the above command is called, the python script runs the input audio file on the ASR cloud engine, and as it runs, I can see Speech Recognition scores for the audio file from Python in the Matlab console. I want to do the following:
(1) Execute multiple such commands in parallel. Lets say, I have 2 input audio files (each having different audio segments), and I would like to run the above command 2 times, but in parallel, using separate processes. I was able to create a code snippet that should be able to do this:
for i=1: 2
userAuthCode=i;
cmd = ['C:\Python27\python.exe runASR.py userAuthCode];
runtime = java.lang.Runtime.getRuntime();
pid(i) = runtime.exec(cmd);
end
for i=1:2
pid(i).waitFor();
% get exit status
rc(i) = pid(i).exitValue();
end
Now, when the above code is executed, I can see ASRE scores for data1 ,but not for data 2.
The exit status in variable rc, is 0,1, which confirms this.
The problem is I do not know the cause of the error, as nothing is printed in
Matlab. How can I get error message from Python captured in a java/Matlab
variable so that i could take a look?
The issue could be that multiple Calls to ASRE in parallel (with different user accounts of course) may not be supported but I won't know unless I can see the error.
(2) When I run a single command standalone, as mentioned at the start of the post, I am able to see Score messages for each audio segment being printed in the Matlab console, as they are obtained from Python. However, with multi-processing using java.lang.Runtime.getRuntime() and the associated code, no messages appears in the Matlab console. Is there a way to display those messages (I am assuming display might be asynchronous?)
Thanks
sedy
!matlab &