I run Matlab2017 on windows 10. I invoke a python script that launches some speech recognition task in the 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 launches the input audio file in the ASR cloud engine, and as it runs, I can see the speech recognition ratings for the audio file with Python in the Matlab console. I want to do the following:
(1) Run several such commands in parallel. Suppose I have 2 input audio files (each of which has different audio segments), and I would like to run the above command 2 times, but in parallel, using separate processes. I managed to create a piece of code that should have done 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 that the above code is executing, I can see the ASRE ratings for data1, but not for data 2.
The exit status in the variable rc is 0.1, which confirms this. The problem is that I do not know the cause of the error, since nothing is printed in Matlab. How can I get an error message from Python written in a java / Matlab variable so that I can take a look?
The problem may be that several ASRE calls in parallel (with different user accounts, of course) may not be supported, but I donβt know if I donβt see the error.
(2) When I run a separate standalone command, as mentioned at the beginning of the post, I can see Score messages for each segment of audio that is printed in the Matlab console, as they are obtained from Python. However, when multiprocessing using java.lang.Runtime.getRuntime () and the associated message code, it does not appear in the Matlab console. Is there a way to display these messages (I assume the display can be asynchronous?)
thanks
Sedy
java python multiprocessing matlab
user915783
source share