{"id":5178,"date":"2021-02-08T17:32:57","date_gmt":"2021-02-08T17:32:57","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=5178"},"modified":"2021-02-09T09:24:33","modified_gmt":"2021-02-09T09:24:33","slug":"deeplabcut","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/deeplabcut\/","title":{"rendered":"DeepLabCut"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/DeepLabCut\">DeepLabCut<\/a> is a toolbox for markerless pose estimation of animals performing various tasks. It uses TensorFlow and is best installed as a conda env. So, <strong>this is an app you should install yourself in your home directory<\/strong>. Full instructions are given below!<\/p>\n<h2>Restrictions on use<\/h2>\n<p>There are no restrictions on accessing this software on the CSF. It is release under the <a href=\"https:\/\/github.com\/DeepLabCut\/DeepLabCut\/blob\/master\/LICENSE\">GNU LGPL license<\/a> and all usage must adhere to that license.<\/p>\n<h2>Installation Procedure<\/h2>\n<p>DeppLabCut will use an Anconda Python <em>conda environment<\/em> to give you a local install in your home directory. So, to install DeepLabCut please run the following commands carefully on the login node:<\/p>\n<pre>\r\n# You can change the name of this directory if you wish (e.g., 'apps')\r\nmkdir -p ~\/software\r\ncd ~\/software\r\n\r\n# These are needed to install DLC (we use a slightly different list later when running DLC)\r\nmodule load tools\/env\/proxy\r\nmodule load tools\/gcc\/git\/2.24.0\r\nmodule load apps\/binapps\/anaconda3\/2020.07\r\nmodule load libs\/cuda\/10.0.130\r\n\r\n# Download the source\r\ngit clone https:\/\/github.com\/AlexEMG\/DeepLabCut.git\r\n\r\n# Install the GPU version. There is a CPU yaml file if you want it.\r\ncd DeepLabCut\/conda-environments\r\nconda env create -f DLC-GPU.yaml\r\n  #\r\n  # This can take a while to complete!\r\n\r\n# Fix a bug that occurs when running the test suite\r\n# See https:\/\/github.com\/DeepLabCut\/DeepLabCut\/issues\/893\r\npip install opencv-python-headless==3.4.8.29\r\npip install tensorpack==0.9.8\r\n\r\n# Create a modulefile (this directory <em>must<\/em> be named ~\/privatemodules)\r\nmkdir -p ~\/privatemodules\r\n\r\n# Note that you will see a &gt; character if typing these next lines\r\n# line-by-line in your shell. That's OK!\r\ncat &gt; ~\/privatemodules\/dlc &lt;&lt;EOF\r\n#%Module1.0\r\nmodule load tools\/env\/proxy\r\nmodule load apps\/binapps\/anaconda3\/2020.07\r\nmodule load libs\/cuda\/10.0.130\r\nmodule load apps\/binapps\/ffmpeg\/4.1.3\r\nEOF\r\n\r\n# Let's check we have created the modulefile\r\nls -l ~\/privatemodules\/dlc\r\n\r\n# That's it\r\n<\/pre>\n<p>The next sections show how to run the software assuming you have previously installed it.<\/p>\n<h2>Set up procedure<\/h2>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/p>\n<p>Load one of the following modulefiles:<\/p>\n<pre>\r\nmodule load use.own dlc\r\n<\/pre>\n<h2>Running the application<\/h2>\n<p>Please do not run DLC on the login node. Jobs should be submitted to the compute nodes via batch or run interactively via the <code>qrsh<\/code> command.<\/p>\n<h3>Interactive session on a GPU node<\/h3>\n<p>The following will log you in to a GPU node so that you can run commands on that node as though you were on the login node (but you have access to the GPU hardware). As an example we show how to run the DLC test script.<\/p>\n<pre>\r\n# Run the following on the login node to log in to a back-end compute node\r\nqrsh -l v100 bash\r\n\r\n# Now load your private modulefile then activate the conda env\r\nmodule load use.own dlc\r\nsource activate DLC-GPU\r\n  #\r\n  # The prompt will change to:\r\n  # (DLC-GPU) [<em>username<\/em>@node8<em>xy<\/em> [csf3] ~]$\r\n\r\n# You can now run python scripts that use DLC\r\npython <em>mycode<\/em>.py\r\n\r\n# For example, to run the test suite:\r\ncd ~\/software\/DeepLabCut\/examples\/\r\npython testscript.py\r\n\r\n# When finished, come out of the conda env\r\nsource deactivate\r\n\r\n# Leave the GPU node\r\nexit\r\n<\/pre>\n<h3>GPU batch job submission<\/h3>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#$ -cwd             # Job will run from the current directory\r\n#$ -l v100          # Run on a GPU node\r\n#$ -pe smp.pe 8     # Number of CPU cores. Can use up to 8 per GPU.\r\n\r\n# Load your private modulefile\r\nmodule load use.own dlc\r\n\r\n# Activate the conda env\r\nsource activate DLC-GPU\r\npython <em>mycode<\/em>.py\r\n\r\n# Deactivate when finished\r\nsource deactivate\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>qsub <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h2>Further info<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/DeepLabCut\">DeepLabCut website<\/a><\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DeepLabCut is a toolbox for markerless pose estimation of animals performing various tasks. It uses TensorFlow and is best installed as a conda env. So, this is an app you should install yourself in your home directory. Full instructions are given below! Restrictions on use There are no restrictions on accessing this software on the CSF. It is release under the GNU LGPL license and all usage must adhere to that license. Installation Procedure DeppLabCut.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/deeplabcut\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":86,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5178","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/5178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=5178"}],"version-history":[{"count":4,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/5178\/revisions"}],"predecessor-version":[{"id":5183,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/5178\/revisions\/5183"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/86"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=5178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}