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

Opening anTrax issue #32

Open MarkJThomas opened 2 years ago

MarkJThomas commented 2 years ago

Hi, thank you for the app! I tried opening the app but kept getting the below error: (I am on Mac OS)

First, I downloaded tensorflow version 1.15 in the conda env tf15 and successfully installed anTrax:

(base) markthomas@Marks-Air anTrax % conda activate tf15

Next, I tried running the code as per the instructions:

(tf15) markthomas@Marks-Air anTrax % antrax configure /Users/markthomas/Desktop/Home/MRes/Other_chapters/Ants/anTraX/anTraX-data/JS16

But got this error:

Traceback (most recent call last): File "/Users/markthomas/miniconda3/envs/tf15/bin/antrax", line 5, in from antrax.cli import main File "/Users/markthomas/miniconda3/envs/tf15/lib/python3.7/site-packages/antrax/cli.py", line 5, in from .matlab import * File "/Users/markthomas/miniconda3/envs/tf15/lib/python3.7/site-packages/antrax/matlab.py", line 22, in ANTRAX_BIN_PATH = ANTRAX_PATH + '/bin/' TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Any help is greatly appreciated!

MarkJThomas commented 2 years ago

I think it's related to MATLAB reading the code, and I thought I had it installed but maybe that is the reason? tyi

asafgal commented 2 years ago

Hey Mark, thanks for trying out anTraX!

Did you set the ANTRAX_PATH environment variable? Make sure it is available within your conda environment.

On 1 Nov 2021, at 13:45, MarkJThomas @.***> wrote:

I think it's related to MATLAB reading the code, and I thought I had it installed but maybe that is the reason? tyi

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Social-Evolution-and-Behavior/anTraX/issues/32#issuecomment-956164563, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACERP5VVG4E5RQI43YKKG4TUJZ4VBANCNFSM5HD2D4CA.

MarkJThomas commented 2 years ago

I didn't, I am not technically sound - do you have/or point me in the direction of how I can do that please?

asafgal commented 2 years ago

See in the installation instructions:

export ANTRAX_PATH=<full path to anTraX repository>
export ANTRAX_USE_MCR=False

You can verify the variables by typing in terminal while inside the conda environment:

echo $ANTRAX_PATH
MarkJThomas commented 2 years ago

ty, can I just confirm I need to install MATLAB?

asafgal commented 2 years ago

Yes, you need either MATLAB or MCR installed. If you have a MATLAB license, it is better to install it rather than using MCR.

On 1 Nov 2021, at 14:13, MarkJThomas @.***> wrote:

ty, can I just confirm I need to install MATLAB?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Social-Evolution-and-Behavior/anTraX/issues/32#issuecomment-956182685, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACERP5XFQWVEZWYJJDSORTLUJ2AABANCNFSM5HD2D4CA.

MarkJThomas commented 2 years ago

I don't have any of them installed or a MATLAB license - do you download it here (MCR): https://uk.mathworks.com/products/compiler/matlab-runtime.html

Please forgive all the questions! This is quite new to me :)

asafgal commented 2 years ago

Yes, choose version R2019a.

Don't worry about it! hope it will work out for you

MarkJThomas commented 2 years ago

Thank you for your support! I managed to get MATLAB installed and connect the paths, and it says Welcome to AnTrax, however, I get this error now:

dyld: Library not loaded: @rpath/libmwlaunchermain.dylib Referenced from: /Users/markthomas/Desktop/Home/MRes/Other_chapters/Ants/anTraX/bin/antrax_maci64_mcr_interface.app/Contents/MacOS/antrax_maci64_mcr_interface Reason: image not found

Do you know what that is referring too?

tyi

asafgal commented 2 years ago

Hey Mark, sorry for the delayed reply.

You also need to define the path to MCR (I'm guessing that what you use):

export ANTRAX_MCR=<full path to MCR installation>

Try to follow the installation steps in the docs!

MarkJThomas commented 2 years ago

Thank you! I did but I didn't know which folder to define the path too, there's a lot of different ones. When I added the path to the main folder nothing opened, then when I defined it to the current folder it opens but I get the above error message. These are the paths currently loaded in my .zprofile:

Screenshot 2021-11-04 at 15 22 24

asafgal commented 2 years ago

The path should be to v96 directory

On 4 Nov 2021, at 17:23, MarkJThomas @.***> wrote:

Thank you! I did but I didn't know which folder to define the path too, there's a lot of different ones. When I added the path to the main folder nothing opened, then when I defined it to the current folder it opens but I get the above error message. These are the paths currently loaded in my .zprofile:

https://user-images.githubusercontent.com/41441629/140349977-1e6c7581-11af-4892-905b-90c083c57bb2.png — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Social-Evolution-and-Behavior/anTraX/issues/32#issuecomment-961150242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACERP5UD5WBG44ISXMNNAYLUKKQONANCNFSM5HD2D4CA.

MarkJThomas commented 2 years ago

updated but just got the same error message:

dyld: Library not loaded: @rpath/libmwlaunchermain.dylib Referenced from: /Users/markthomas/Desktop/Home/MRes/Other_chapters/Ants/anTraX/bin/antrax_maci64_mcr_interface.app/Contents/MacOS/antrax_maci64_mcr_interface Reason: image not found (tf15) markthomas@Marks-Air ~ %

Maybe it's just not meant to be :D

Screenshot 2021-11-04 at 17 40 04

janamach commented 2 years ago

I just installed anTraX on a new work computer running Ubuntu 20.04. I had anTraX working on multiple other machines, so I just copied all my config files as I usually do (which usually works). But not this time. For whatever reason I got this error message:

$ antrax configure 

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

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

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

02/03/22 21:12:54 -D- antrax cli entry point
02/03/22 21:12:54 -D- running matlab mcr 
02/03/22 21:12:54 -D- command is: /home/jana/src/anTraX/bin/antrax_glnxa64_mcr_interface antrax
/home/jana/src/anTraX/bin/antrax_glnxa64_mcr_interface: error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory
02/03/22 21:12:54 -D- matlab app exited with code 127

A quick search for libmwlaunchermain lead me to your post, @MarkJThomas. On my system, something weird has happened and the library was not loading even though the correct LD_LIBRARY_PATH was set.

A similar issue is discussed here: https://mathworks.com/matlabcentral/answers/267562-how-can-i-resolve-this-mcc-runtime-error-cannot-open-shared-object-library#answer_211306 And I found my "solution" here: https://mathworks.com/help/compiler/mcr-path-settings-for-run-time-deployment.html

The "solution" I found is bizarre, but it works for some reason:

LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Runtime/v96/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/extern/bin/glnxa64

mypath=$LD_LIBRARY_PATH
mypath="${mypath:+${mypath}:}"
export LD_LIBRARY_PATH=$mypath

And then antrax loads normally:

$ antrax configure

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

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

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

02/03/22 21:47:08 -D- antrax cli entry point
02/03/22 21:47:08 -D- running matlab mcr 
02/03/22 21:47:08 -D- command is: /home/jana/src/anTraX/bin/antrax_glnxa64_mcr_interface antrax
21:47:14 -D- starting antrax configure app
app closing..
02/03/22 21:47:20 -D- matlab app exited with code 0

While doing simply this LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}" doesn't help. And the above "solution" makes little sense, because LD_LIBRARY_PATH barely changes after the procedure:

$ echo ${LD_LIBRARY_PATH}
/usr/local/MATLAB/MATLAB_Runtime/v96/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96/extern/bin/glnxa64::

I really don't understand this, it's very weird... Anyhow, I am writing this here in case somebody else runs into this problem.

@MarkJThomas looking at your post, I think you should try following the steps in the link I posted above for macOS. If it's a library not found thing, it should be fixable.