bonsai-rx / deeplabcut

A Bonsai interface for real-time markerless pose estimation using DeepLabCut
MIT License
47 stars 9 forks source link

Installation diary (Bonsai + dlc-live on windows) #18

Open chiyu1203 opened 1 year ago

chiyu1203 commented 1 year ago

Hi I just want to post my diary here as Bonsai team a lot.

I started with Deeplabcut live under python and got familiar with the functions first. And then I thought it would be quite useful to setup the experiment via Bonsai. I started to follow the installation guidance on this page, so this diary will be pretty much based on that including installing tf 2.8 and putting all the .dll into Bonsai extension. Therefore a new deeplabcut-Bonsai users should follow those guidance first (thankfully the latest Cudatool kit and cudnn support NVIDIA GPU 3060 ti, which makes things slightly easier).

https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#abstract https://www.tensorflow.org/install/pip https://github.com/bonsai-rx/deeplabcut

Although on this page, we should be able to "Extract to a folder and launch WinPython Command Prompt.exe." as the homepage suggests, my first problem is that I did not want to install wxpython in the base environment. This is just because I am a beginner and really do not much about those software and libraries. Instead, I created a virtual conda environment first under python 3.7 version (I tried with other python version but this one seems to have less probably with pip install -U wxpython). Then after entering the virtual environment I did the following: pip install -U wxpython

conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 pip install tensorflow-gpu==2.8.0 pip install tensorflow==2.8.0 (tensorflow website suggests that we should only need tensorflow==2.8.0 though, even for GPU support)

pip install deeplabcut[gui]==2.2.0.6 (the latest deeplabcut should work though, I was just be cautious)

pip install --upgrade protobuf==3.20 (somehow this was too advanced so I downloaded it) Then everything works magically

For the Bonsai part I pretty much do whatever this page says. The only issue I had was somehow I did not have zlibwapi.dll when I was installing cudnn and cuda tool kit and nvidia driver. On the nvidia installation guidance https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-zlib-windows, the link to this library seems to be broken so I had to find a 64bit zlibwapi.dll from another source (32 bit did not work for me as my pc is 64 bit and I found it here https://www.topwizprogramming.com/freecode_zlibwapi.html) and also put it in the Bonsai's Extensions. Then somehow everything started to work magically. Hope this diary helps those had problem getting dlc-live work on Bonsai

glopesdev commented 1 year ago

Thanks @chiyu1203 this diary is very useful! I agree it makes sense to include a conda install guide together with the winpython one, and try to understand a bit better the issue you had with zlibwapi.dll. Will leave this issue open to inform those updates.