updated COLAB notebooks to install a CUDA version compatible with DLC by n-poulsen · Pull Request #2506 · DeepLabCut/DeepLabCut

@@ -1,37 +1,10 @@ { "nbformat": 4, "nbformat_minor": 0, "metadata": { "accelerator": "GPU", "colab": { "name": "Colab_DEMO_mouse_openfield.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" "colab_type": "text", "id": "view-in-github" }, "source": [ "<a href=\"https://colab.research.google.com/github/DeepLabCut/DeepLabCut/blob/master/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" Expand Down Expand Up @@ -74,42 +47,52 @@ }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Installs a CUDA version compatible with tensorflow on COLAB\n", "!apt update && apt install cuda-11-8" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Ew6r4hotoQjt" }, "outputs": [], "source": [ "# Clone the entire deeplabcut repo so we can use the demo data:\n", "!git clone -l -s https://github.com/DeepLabCut/DeepLabCut.git cloned-DLC-repo\n", "%cd cloned-DLC-repo\n", "!ls" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "yDaY78dFoxyD" }, "outputs": [], "source": [ "%cd /content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30\n", "!ls" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "q23BzhA6CXxu" }, "outputs": [], "source": [ "# Install the latest DeepLabCut version (this will take a few minutes to install all the dependencies!)\n", "%cd /content/cloned-DLC-repo/\n", "!pip install \".[tf]\"" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand All @@ -122,29 +105,29 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "sXufoX6INe6w" }, "outputs": [], "source": [ "import deeplabcut" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Z7ZlDr3wV4D1" }, "outputs": [], "source": [ "#create a path variable that links to the config file:\n", "path_config_file = '/content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30/config.yaml'\n", "\n", "# Loading example data set:\n", "deeplabcut.load_demo_data(path_config_file)" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand All @@ -158,9 +141,11 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "_pOvDq_2oEJW" }, "outputs": [], "source": [ "#let's also change the display and save_iters just in case Colab takes away the GPU... \n", "#if that happens, you can reload from a saved point. Typically, you want to train to 200,000 + iterations.\n", Expand All @@ -170,9 +155,7 @@ "\n", "#this will run until you stop it (CTRL+C), or hit \"STOP\" icon, or when it hits the end (default, 1.03M iterations). \n", "#Whichever you chose, you will see what looks like an error message, but it's not an error - don't worry...." ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand All @@ -196,17 +179,17 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "nv4zlbrnoEJg" }, "outputs": [], "source": [ "%matplotlib notebook\n", "deeplabcut.evaluate_network(path_config_file,plotting=True)\n", "\n", "# Here you want to see a low pixel error! Of course, it can only be as good as the labeler, so be sure your labels are good!" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand Down Expand Up @@ -234,15 +217,15 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Y_LZiS_0oEJl" }, "outputs": [], "source": [ "videofile_path = ['/content/cloned-DLC-repo/examples/openfield-Pranav-2018-10-30/videos/m3v1mp4.mp4'] #Enter the list of videos to analyze.\n", "deeplabcut.analyze_videos(path_config_file,videofile_path, videotype='.mp4')" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand All @@ -256,14 +239,14 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "6aDF7Q7KoEKE" }, "outputs": [], "source": [ "deeplabcut.create_labeled_video(path_config_file,videofile_path)" ], "execution_count": null, "outputs": [] ] }, { "cell_type": "markdown", Expand All @@ -277,14 +260,41 @@ }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "gX21zZbXoEKJ" }, "outputs": [], "source": [ "deeplabcut.plot_trajectories(path_config_file,videofile_path)" ], "execution_count": null, "outputs": [] ] } ], "metadata": { "accelerator": "GPU", "colab": { "collapsed_sections": [], "name": "Colab_DEMO_mouse_openfield.ipynb", "provenance": [] }, "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } ] }, "nbformat": 4, "nbformat_minor": 0 }