mooch443 / trex

TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields.
https://trex.run
GNU General Public License v3.0
82 stars 8 forks source link

Endless "python not initialised" warning when entering training mode #209

Open samrma opened 1 year ago

samrma commented 1 year ago

Description Fails to enter training mode - endless code warning freezes "

Describe the bug I installed Trex using conda (conda create -n tracking -c trexing trex). I can open the GUI, create a pv file for a video, and make manual ID adjustments, but when I want to enter Visual Identification, I am faced with a continuous (and endless) loop of error messages in the Anaconda Prompt - the primary message is the focus of the attached image. This freezes the GUI screen on "Generating Images" and I am unable to abort this process. I attempted to address the code issues highlighted but, when I did and repeated the process, I was faced with a new error regarding the code in another file that required code adjustment (e.g., the deprecated use of np.bool and np.object). The final error I encountered no longer had a specific file to address, rather that np.int was deprecated in general. I'm no programmer and believe that my inexpert tweaking of random files is unlikely to be a good solution. Is there a clearer explanation for this issue? I've tried uninstalling and reinstalling anaconda, Trex, and I've updated and installed all the dependencies I believe to be required, to no avail.

Expected behavior (if it is not a simple crash) To enter the training mode screen.

Computer (please complete the following information):

Muginson commented 1 year ago

I am also having this exact issue, no idea what to do.

mooch443 commented 1 year ago

Hey, sorry to hear that you are experiencing these issues. May I ask when you installed this version? Since this command just installs the "current" version at all times. The loop is endless because it does not seem to terminate the program and instead tries again.

In general the error seems to indicate that the numpy version installed is too new for the code to run. Can you provide a conda list command output for your environment? You could try to install a 1.19 version of numpy (either using pip or preferably conda if that is possible). In order to do that you should simply run conda install numpy=1.19 from within the environment (make sure you're not in the base environment).

Potential problems with this might be... other software's versions incompatible. But in order to judge that, I'd first have to see what the environment looks like.

@samrma sorry for the late response. I had another response planned but it did not pan out, and then I was swamped :( -Tristan

samrma commented 1 year ago

Thanks for your comment, Tristan - I appreciate your help with this. I assumed it was a compatibility issue but couldn't understand why - my experience with anaconda is limited (I don't use it for anything else) but I've only ever used the installation code provided (i.e., conda create -n tracking -c trexing trex), which presumably installs the correctly compatible packages. I attempted to install numpy 1.19 in my previous environment as suggested but got the same loop. Attached is the conda list for a fresh environment (named fishtracker) - I hope this helps. Thanks again!

List_1 List_2

mooch443 commented 11 months ago

Curious. You got the same loop, even though the numpy installation was successful? Thats weird since numpy with versions below 1.20 should not even produce a warning here. Are you sure the installation succeeded?

I just tried a fresh install on Windows using:

conda create -n late_response_again --override-channels -c trexing -c defaults trex=1.1.9 numpy=1.23 tensorflow-gpu

and that seems to work through the entire visual identification pipeline. Notice I added --override-channels (just to be sure you dont have anything funny going on with channels on your PC), and added a numpy=1.23 (which will install "any" 1.23.x version of numpy). In my case it got 1.23.5. I also added tensorflow-gpu since it didn't install it automatically.

Edit: oops, nevermind. It installed an old CPU version of TRex instead. Updated the above command. In any case - the problem seems to be that you get 1.26.x on a fresh install, which is incompatible it seems.