Social-Evolution-and-Behavior / anTraX

anTraX: high throughput tracking of color-tagged insects
https://antrax.readthedocs.io/
GNU General Public License v3.0
17 stars 3 forks source link

Commit b3def69: GUIs works with MCR, but MATLAB giving new errors #8

Closed janamach closed 3 years ago

janamach commented 3 years ago

While looking into the #5 issue, new errors occurred with MATLAB after installing the updated software. The exact same installation works with MCR, but not with MATLAB it gives new errors:

(matlab2019a) jana@str09:~/src/anTraX-data$ antrax configure JS16/

==================================================================================

Welcome to anTraX - a software for tracking color tagged ants (and other insects)

==================================================================================

03/02/21 11:52:24 -D- antrax cli entry point
11:52:38 -D- starting antrax configure app
11:52:40 -D- set_experiment function
11:52:40 -D- initializing expreader object
11:52:40 -I- Reading video information from file
Error using matlab.ui.Figure/getId
Invalid or deleted object.

Error in matlab.ui.internal.dialog.DialogHelper.getFigureID (line 8)
            out = f.getId();

Error in matlab.ui.internal.dialog.DialogHelper.validateUIfigure (line 21)
            id = matlab.ui.internal.dialog.DialogHelper.getFigureID(h);

Error in matlab.ui.dialog.ProgressDialog (line 45)
            obj.FigureID = matlab.ui.internal.dialog.DialogHelper.validateUIfigure(f);

Error in uiprogressdlg (line 33)
progressDialog = matlab.ui.dialog.ProgressDialog(hUIFigure, varargin{:});

Error in antrax/set_experiment (line 315)
            d = uiprogressdlg(app.UIFigure,'Title','Loading experiment','Indeterminate','on');

Error in antrax/startupFcn (line 1184)
            set_experiment(app, Trck, p.Results.session)

Error in antrax (line 3563)
            runStartupFcn(app, @(app)startupFcn(app, varargin{:}))

Traceback (most recent call last):
  File "/home/jana/anaconda3/envs/matlab2019a/bin/antrax", line 8, in <module>
    sys.exit(main())
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 651, in main
    """)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/sigtools/modifiers.py", line 158, in __call__
    return self.func(*args, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 363, in run
    ret = cli(*args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 262, in _cli
    return func('{0} {1}'.format(name, command), *args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 104, in configure
    launch_matlab_app('antrax', args, mcr=mcr)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/matlab.py", line 198, in launch_matlab_app
    app = eval('eng.' + appname + '(' + ','.join([str(a) for a in args]) + ')')
  File "<string>", line 1, in <module>
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/matlabengine.py", line 71, in __call__
    _stderr, feval=True).result()
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/futureresult.py", line 67, in result
    return self.__future.result(timeout)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/fevalfuture.py", line 82, in result
    self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.MatlabExecutionError: 
  File /usr/local/MATLAB/R2019a/toolbox/matlab/uitools/uicomponents/components/+matlab/+ui/+internal/+dialog/DialogHelper.m, line 8, in DialogHelper.getFigureID

  File /usr/local/MATLAB/R2019a/toolbox/matlab/uitools/uicomponents/components/+matlab/+ui/+internal/+dialog/DialogHelper.m, line 21, in DialogHelper.validateUIfigure

  File /usr/local/MATLAB/R2019a/toolbox/matlab/uitools/uicomponents/components/+matlab/+ui/+dialog/ProgressDialog.m, line 45, in ProgressDialog.ProgressDialog

  File /usr/local/MATLAB/R2019a/toolbox/matlab/uitools/uicomponents/components/uiprogressdlg.m, line 33, in uiprogressdlg

  File /home/jana/src/anTraX/matlab/apps/antrax.mlapp, line 315, in antrax.set_experiment

  File /home/jana/src/anTraX/matlab/apps/antrax.mlapp, line 1184, in antrax.startupFcn

  File /home/jana/src/anTraX/matlab/apps/antrax.mlapp, line 3563, in antrax.antrax
Invalid or deleted object.

and

(matlab2019a) jana@str09:~/src/anTraX-data$ antrax graph-explorer JS16/

==================================================================================

Welcome to anTraX - a software for tracking color tagged ants (and other insects)

==================================================================================

Undefined function or variable 'graph_explorer'.

Traceback (most recent call last):
  File "/home/jana/anaconda3/envs/matlab2019a/bin/antrax", line 8, in <module>
    sys.exit(main())
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 651, in main
    """)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/sigtools/modifiers.py", line 158, in __call__
    return self.func(*args, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 363, in run
    ret = cli(*args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 262, in _cli
    return func('{0} {1}'.format(name, command), *args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 142, in graph_explorer
    launch_matlab_app('graph_explorer', args, mcr=mcr)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/matlab.py", line 198, in launch_matlab_app
    app = eval('eng.' + appname + '(' + ','.join([str(a) for a in args]) + ')')
  File "<string>", line 1, in <module>
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/matlabengine.py", line 71, in __call__
    _stderr, feval=True).result()
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/futureresult.py", line 67, in result
    return self.__future.result(timeout)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/fevalfuture.py", line 82, in result
    self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.MatlabExecutionError: Undefined function 'graph_explorer' for input arguments of type 'int64'.
janamach commented 3 years ago

Edit: the errors are the same between the commits, the difference that confused me that with the second command MATLAB did not attempt to load a GUI. Please ignore this thread for now.

asafgal commented 3 years ago

Totally my fault here (the graph-explorer issue), I was careless with patching this issue. Try now.

janamach commented 3 years ago

By 'Try now' you mean pulling from the debug-jana branch, right?

I did not notice a difference in terms of performance with MCR, with MATLAB it looks the same locally and loads normally remotely. I think #5 is the real issue here...

To re-iterate, this error occurs locally:

(matlab2019a) jana@str09:~/src/anTraX-data$ antrax graph-explorer JS16/

==================================================================================

Welcome to anTraX - a software for tracking color tagged ants (and other insects)

==================================================================================

Undefined function or variable 'graph_explorer'.

Traceback (most recent call last):
  File "/home/jana/anaconda3/envs/matlab2019a/bin/antrax", line 8, in <module>
    sys.exit(main())
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 651, in main
    """)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/sigtools/modifiers.py", line 158, in __call__
    return self.func(*args, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 363, in run
    ret = cli(*args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 262, in _cli
    return func('{0} {1}'.format(name, command), *args)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/clize/runner.py", line 220, in __call__
    return func(*posargs, **kwargs)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/cli.py", line 142, in graph_explorer
    launch_matlab_app('graph_explorer', args, mcr=mcr)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/antrax/matlab.py", line 204, in launch_matlab_app
    app = eval('eng.' + appname + '(' + ','.join([str(a) for a in args]) + ')')
  File "<string>", line 1, in <module>
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/matlabengine.py", line 71, in __call__
    _stderr, feval=True).result()
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/futureresult.py", line 67, in result
    return self.__future.result(timeout)
  File "/home/jana/anaconda3/envs/matlab2019a/lib/python3.6/site-packages/matlab/engine/fevalfuture.py", line 82, in result
    self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.MatlabExecutionError: Undefined function 'graph_explorer' for input arguments of type 'int64'.

And this is the normal output when ran remotely with ssh -X:

==================================================================================

Welcome to anTraX - a software for tracking color tagged ants (and other insects)

==================================================================================

03/02/21 13:35:06 -D- antrax cli entry point
13:35:22 -D- starting antrax configure app
13:35:24 -D- set_experiment function
13:35:24 -D- initializing expreader object
13:35:24 -I- Reading video information from file
13:35:39 -I- opening video file JS16/videos//1_6/JS16_1.mp4
13:35:39 -D- Running ffprobe #1 for file JS16/videos//1_6/JS16_1.mp4

mov,mp4,m4a,3gp,3g2,mj2
10402940

13:35:39 -D- Running ffprobe #2 for file JS16/videos//1_6/JS16_1.mp4

960
720
yuvj420p
10/1
0.000000
300.000000
3000

13:35:40 -D- antrax configure app ready!

I think this issue is redundant with #5. Sorry for starting it - I thought I saw a new error...

asafgal commented 3 years ago

No, you are absolutely right - when patching the issue for mcr I broke the same functionality with full matlab. Pull & try again now.

janamach commented 3 years ago

This is so confusing...

Pull & try again now.

It does not complain anymore when I run it locally, so your last commit fixed the issue.

What is extremely confusing is that

Anyway, thank you for fixing this issue. This discrepancy between local and ssh got me so confused I wasn't sure if the errors I saw were "real" :)

asafgal commented 3 years ago

Thank you for helping improve anTraX! Hopefully it will justify the effort :-)

janamach commented 3 years ago

Thank you for helping :-)