MATLAB example hangs
I have installed OptUnity on Win 10 64 bit and have Anaconda Python 3 and MATLAB R2015a. The example MATLAB script optunity_example in wrappers/matlab hangs. I traced it to expected behavious. In Package Com under package Optunity popen opens a Java.Server.Socket and waits on it. is this the expected behaviour? Where will the socket get an input from?
%% create server socket serverSocket = java.net.ServerSocket(0); port = serverSocket.getLocalPort(); ..... %% create communication socket and channels socket = serverSocket.accept(); in = java.io.PrintWriter(socket.getOutputStream(), true); out = java.io.BufferedReader(java.io.InputStreamReader(socket.getInputStream()));
Execution never moves past serverSocket.accept();
It is using port 53629
MATLAB should spawn Optunity as a standalone (background) application and then communicate with it through sockets. For some reason, this fails with some combinations of MATLAB/Windows versions, but works on most others. Unfortunately, we have been unable to reproduce the problem with the versions we have at hand, but we have heard similar issues by others.
The Optunity background program is in Python, so one potential issue may be that Python is not installed, or not installed system wide. You may try to remedy this issue by reinstalling Python (preferably 2.7, which is tested more than 3.x).
2016-09-21 21:31 GMT+02:00 Qunal [email protected]:
I have installed OptUnity on Win 10 64 bit and have Anaconda Python 3 and MATLAB R2015a. The example MATLAB script optunity_example in wrappers/matlab hangs. I traced it to expected behavious. In Package Com under package Optunity popen opens a Java.Server.Socket and waits on it. is this the expected behaviour? Where will the socket get an input from?
%% create server socket serverSocket = java.net.ServerSocket(0); port = serverSocket.getLocalPort(); ..... %% create communication socket and channels socket = serverSocket.accept(); in = java.io.PrintWriter(socket.getOutputStream(), true); out = java.io.BufferedReader(java.io.InputStreamReader(socket. getInputStream()));
Execution never moves past serverSocket.accept();
It is using port 53629
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/claesenm/optunity/issues/78, or mute the thread https://github.com/notifications/unsubscribe-auth/AFAu_ug7cUgKljvWYOrCkCJOKmaJnj40ks5qsYYqgaJpZM4KDMJN .
Thanks. Python is installed and I have run standalone.py as a client or as a server. Also notebook python demo basic_cross-validation seems to work. However I am using Anaconda with python 3.5 . Guess that may be an issue.
In principle everything should be 3.x compatible, as we include those Python versions in our test suite. Maybe the Anaconda distribution has an incompatibility, I will try to check that out ASAP.
You should never have to run standalone.py manually (as client or server). If everything works properly, it should be launched in the background by the non-Python platform you're on (MATLAB/R/...). The problem that occurs when MATLAB seems to hang forever is a communication problem between MATLAB and standalone.py (can be caused by socket issues or the fact standalone.py isn't running in the first place, i.e., due an installation problem).
2016-09-23 17:43 GMT+02:00 Qunal [email protected]:
Thanks. Python is installed and I have run standalone.py as a client or as a server. Also notebook python demo basic_cross-validation seems to work. However I am using Anaconda with python 3.5 . Guess that may be an issue.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/claesenm/optunity/issues/78#issuecomment-249227876, or mute the thread https://github.com/notifications/unsubscribe-auth/AFAu_l2IXzwgAxRhjEs1SmcGlOUvXDxpks5qs_O0gaJpZM4KDMJN .
I got the same issue in Matlab 2019b on Windows 10. The issue was solved by installing python 2 and set it to system variables. I also tried with python 3 and it did not work completely, just as @claesenm said.