kristinbranson / APT

Animal Part Tracker
GNU General Public License v3.0
72 stars 14 forks source link

GPU not being detected on Windows #323

Closed hkneu-95 closed 4 years ago

hkneu-95 commented 4 years ago

Hi, I was trying to use DL on my windows workstation. I have a GTX 1060 GPU and setup up the conda APT environment with the required dependencies. However, upon launching the tracking with the selected backend as conda and algo as DL, Matlab reports that no GPU was found.

Could you please guide me as to how I should try to start up to get the tracking up and running soon.

Thank you!

allenleetc commented 4 years ago

Hi hkneu! We've had a lot of active development and it looks like there are some minor regressions with the Conda backend. I pushed a couple fixes but still have some testing to do. Let me work on this a bit and I will get back in touch soon. Thanks for using APT and reporting this issue!

hkneu-95 commented 4 years ago

Dear Allen, Thanks a lot. Looking forward to your inputs! It would also be very helpful if you advised me how to start the training if APT is configured to use the Conda backend.

Thanks again.

allenleetc commented 4 years ago

Hey hkneu, I pushed some more updates. DL Train and Track are both working for me now using Conda on my Win10 machine.

Please pull the latest code, then restart your MATLAB and APT if you have them open.

No special actions should be necessary to start training/tracking with Conda. After following the setup/install instructions for using Conda with APT, you can select the Conda backend under the menu item Track>GPU Backend Configuration (it sounds like you already did this). You can test your machine configuration using the "Test backend configuration" menu item -- I just pushed some tests for Conda so this will do some basic checking for you. If all the tests pass, just press the Train button to start training!

If the tests fail, a couple things come to mind. On my machine, I had to add <install location>\Anaconda3\condabin to my system PATH. On Win10, you can type 'env' into the Search Box, then click Environment Variables, and I added an entry to the Path under System variables.

Another possibility is that depending on your graphics card, you may be under a memory limit that we have heuristically set in the APT code. You can change this limit by typing edit DLBackEndClass.m in MATLAB and changing the minFreeMem setting based on your card's memory specifications. Note that memory constraints may limit your deep-learning performance and you may have to increase your Downsample factor and/or decrease your Training batch size in your Tracking Parameters.

Let us know how it goes we will be here!

hkneu-95 commented 4 years ago

Dear Allen, Thanks a lot. Was able to get it up and running now. Started the training and will track.

Thanks!

allenleetc commented 4 years ago

Great glad to hear it! Let us know how it goes.

kevinung11 commented 4 years ago

Hi Allen,

I'm having similar problems with a GTX 1070 Ti GPU on a Windows platform. I've gotten the latest code and tried the things you mentioned above. I reduced the training batch size to 5 so that it would require 7 GM of memory (we have 8 GB dedicated) and edited DLBackEndClass.m to set the minFreemem to 7000. Whenever I try to test the backend configuration, I get the following error.

**Testing activate APT... activate APT FAILURE. Error with 'activate APT'. Does your system path include condabin?

I installed Anaconda 3 (Windows 10) following the provided setup here. And I also included the condabin folder to the system path.

Any insight on how to get it running? Thanks!

allenleetc commented 4 years ago

Hmm strange. All that test is trying to do is run the command 'activate APT' which should call the activate.bat batch file in \<Anaconda3>\condabin.

For instance, within MATLAB, what happens if you try this?

[st, res] = system('activate APT')

How about if you open a Command Prompt in your Windows machine (under Windows System if your search bar is broken) and try this?

where activate

activate APT
kevinung11 commented 4 years ago

Yeah I thought that's what it was trying to do. It seems like you're on the right track though [st, res] = system('activate APT') in MATLAB returns:

st = 1 res = ''activate' is not recognized as an internal or external command, operable program or batch file.'

In the command prompt, where activate returns:

INFO: Could not find files for the given pattern(s).

And so activate APT returns:

'activate' is not recognized as an internal or external command, operable program or batch file.

allenleetc commented 4 years ago

Yeah your computer can't find ...\<Anaconda3>\condabin\activate.bat. Can you check your system path and the path you added etc? You will probably be good once you can run 'activate APT' in your Windows command prompt.

kevinung11 commented 4 years ago

Ah, I added the condabin path to the wrong variable. Seems to be working now! Thanks so much for all the help troubleshooting!

allenleetc commented 4 years ago

You bet glad you are up and running!