Visitar URL original
DeepLabCut/docs/installation.md at master · E23K/DeepLabCut · GitHub
Skip to content

Latest commit

 

History

History
137 lines (74 loc) · 11.4 KB

installation.md

File metadata and controls

137 lines (74 loc) · 11.4 KB

How To Install DeepLabCut: DLC

DeepLabCut can be run on Windows, Linux, or MacOS (see also technical considerations).

The installation process is as easy as this figure ➡️

To get the most out of our docs and code, we also recommend watching:

📹 how to navigate our docs

📹 how to test your installation!

Please note, there are several modes of installation, and the user should decide to either use a system-wide (see note below), Anaconda environment based installation (recommended), or the supplied Docker container (recommended for Ubuntu advanced users). One can of course also use other Python distributions than Anaconda, but Anaconda is the easiest route.

Step 1: You need to have Python 3 installed, and we highly recommend using Anaconda to do so.

Simply download the appropriate files here: https://www.anaconda.com/distribution/

  • Anaconda is perhaps the easiest way to install Python and additional packages across various operating systems. With Anaconda you create all the dependencies in an environment on your machine.
  • You first need to decide if you want to use a CPU or GPU for your models: (Note, you can also use the CPU-only for project management and labeling the data! Then, for example, use Google Colaboratory GPUs for free (read more here and there are a lot of helper videos on our YouTube channel!).

    -- CPU? Great, ignore the rest and CLICK HERE to get your simple one-line of code installation file!

    -- GPU? If you want to use your own GPU (i.e., a GPU is in your workstation), then you need to be sure you have a CUDA compatable GPU and CUDA installed. PLease note, which CUDA you install depends on what version of tensorflow you want to use. So, please check below carefully. Then, please click here to get the file (and more info) you need to set up your GPU conda file.

*For the experts, it's also on pypi, simply pip install deeplabcut[gui] (and have tensorflow 1.x and wxPython also installed) for DeepLabCut + gui_size

*NEW: deeplabcut without the GUIs can be installed with pip install deeplabcut. The only other requirement is having TensorFlow 1.x installed.

The most common "new user" hurdle is installing and using your GPU:

CRITICAL: If you have a GPU, you should FIRST then install the NVIDIA CUDA (10 or LOWER) package and an appropriate driver for your specific GPU, then you can use the supplied conda file. Please follow the instructions found here https://www.tensorflow.org/install/gpu, and more tips below, to install the correct version of CUDA and your graphic card driver. The order of operations matters.

  • Here we provide notes on how to install and check your GPU use with TensorFlow (which is used by DeepLabCut and already installed with the Anaconda files above). Thus, you do not need to independently install tensorflow.

All of the TensorFlow 1.x versions work with DeepLabCut. But, please be mindful different versions of TensorFlow require different CUDA versions.

Note, if you wish to use TensorFlow 2.x, then you should use currently DeepLabCut-core. Here is a blog post describing how to do this and the roadmap for the eventual change to tensorflow 2 for this repo as well.

As the combination of TensorFlow and CUDA matters, we strongly encourgae you to check your driver/cuDNN/CUDA/TensorFlow versions on this StackOverflow post.

Here is an example on how to install the GPU driver + CUDA 10 + TensorFlow 1.13.1 will follow here:

FIRST, install a driver for your GPU (and compatable up to CUDA 10). Find DRIVER HERE: https://www.nvidia.com/download/index.aspx

  • check which driver is installed by typing this into the terminal: nvidia-smi.

SECOND, install CUDA 10 (higher versions are not currently supported): https://developer.nvidia.com/ (Note that cuDNN, https://developer.nvidia.com/cudnn, is supplied inside the anaconda environment files, so you don't need to install it again).

THIRD: Git Clone this repo to get the conda env. Launch the provided Anaconda Environment File "DLC-GPU" (see here!)

  • note, tensorflow is installed inside this env.

FOURTH, Please check your CUDA and TensorFlow installation with the lines below:

  • In the terminal, run:

    nvcc -V to check your installed version(s).

  • The best practice is to then run the supplied testscript.py (this is inside the examples folder you acquired when you git cloned the repo). Here is more information/a short video on running the testscript.

  • Additionally, if you want to use the bleeding edge, with yout git clone you also get the latest code. While inside the main DeepLabCut folder, you can run ./reinstall.sh to be sure it's installed (more here: https://github.com/DeepLabCut/DeepLabCut/wiki/How-to-use-the-latest-GitHub-code)

  • You can test that your GPU is being properly engaged with these additional tips.

  • Ubuntu users might find this installation guide for a fresh ubuntu install useful as well.

Troubleshooting:

TensorFlow: Here are some additional resources users have found helpful (posted without endorsement):

FFMEG:

DEEPLABCUT:

  • if you git clone or download this folder, and are inside of it then import deeplabcut will import the package from there rather than from the latest on PyPi!

You're ready to Run DeepLabCut!

Now you can use Jupyter Notebooks, Spyder, and to train just use the terminal, to run all the code!

System-wide considerations:

If you perform the system-wide installation, and the computer has other Python packages or TensorFlow versions installed that conflict, this will overwrite them. If you have a dedicated machine for DeepLabCut, this is fine. If there are other applications that require different versions of libraries, then one would potentially break those applications. The solution to this problem is to create a virtual environment, a self-contained directory that contains a Python installation for a particular version of Python, plus additional packages. One way to manage virtual environments is to use conda environments (for which you need Anaconda installed).

Technical Considerations:

  • Computer:

  • Computer Hardware:

    • Ideally, you will use a strong GPU with at least 8GB memory such as the NVIDIA GeForce 1080 Ti or 2080 Ti. A GPU is not necessary, but on a CPU the (training and evaluation) code is considerably slower (10x) for ResNets, but MobileNets are faster (see WIKI). You might also consider using cloud computing services like Google cloud/amazon web services or Google Colaboratory.
  • Camera Hardware:

    • The software is very robust to track data from any camera (cell phone cameras, grayscale, color; captured under infrared light, different manufacturers, etc.). See demos on our website.
  • Software:

    • Operating System: Linux (Ubuntu), MacOS* (Mojave), or Windows 10. However, the authors strongly recommend Ubuntu! *MacOS does not support NVIDIA GPUs (easily), so we only suggest this option for CPU use or a case where the user wants to label data, refine data, etc and then push the project to a cloud resource for GPU computing steps, or use MobileNets.
    • Anaconda/Python3: Anaconda: a free and open source distribution of the Python programming language (download from https://www.anaconda.com/). DeepLabCut is written in Python 3 (https://www.python.org/) and not compatible with Python 2.
    • pip install deeplabcut
    • TensorFlow
      • You will need TensorFlow (we used version 1.0 in the paper, later versions also work with the provided code (we tested TensorFlow versions 1.0 to 1.14) for Python 3 with GPU support.
      • To note, is it possible to run DeepLabCut on your CPU, but it will be VERY slow (see: Mathis & Warren). However, this is the preferred path if you want to test DeepLabCut on your own computer/data before purchasing a GPU, with the added benefit of a straightforward installation! Otherwise, use our COLAB notebooks for GPU access for testing.
    • Docker: We highly recommend advaced users use the supplied Docker container. NOTE: this container does not work on windows hosts!

Return to readme.