<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="shortcut icon" href="../img/favicon.ico"> <title>Installation - Neural Network Distiller</title> <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="../css/theme.css" type="text/css" /> <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" /> <link rel="stylesheet" href="../css/highlight.css"> <link href="../extra.css" rel="stylesheet"> <script> // Current page data var mkdocs_page_name = "Installation"; var mkdocs_page_input_path = "install.md"; var mkdocs_page_url = "/install/index.html"; </script> <script src="../js/jquery-2.1.1.min.js"></script> <script src="../js/modernizr-2.8.3.min.js"></script> <script type="text/javascript" src="../js/highlight.pack.js"></script> </head> <body class="wy-body-for-nav" role="document"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav"> <div class="wy-side-nav-search"> <a href="../index.html" class="icon icon-home"> Neural Network Distiller</a> <div role="search"> <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul class="current"> <li class="toctree-l1"> <a class="" href="../index.html">Home</a> </li> <li class="toctree-l1 current"> <a class="current" href="index.html">Installation</a> <ul class="subnav"> <li class="toctree-l2"><a href="#distiller-installation">Distiller Installation</a></li> <ul> <li><a class="toctree-l3" href="#clone-distiller">Clone Distiller</a></li> <li><a class="toctree-l3" href="#create-a-python-virtual-environment">Create a Python virtual environment</a></li> <li><a class="toctree-l3" href="#install-dependencies">Install dependencies</a></li> </ul> </ul> </li> <li class="toctree-l1"> <a class="" href="../usage/index.html">Usage</a> </li> <li class="toctree-l1"> <a class="" href="../schedule/index.html">Compression scheduling</a> </li> <li class="toctree-l1"> <span class="caption-text">Compressing models</span> <ul class="subnav"> <li class=""> <a class="" href="../pruning/index.html">Pruning</a> </li> <li class=""> <a class="" href="../regularization/index.html">Regularization</a> </li> <li class=""> <a class="" href="../quantization/index.html">Quantization</a> </li> </ul> </li> <li class="toctree-l1"> <a class="" href="../algorithms/index.html">Algorithms</a> </li> <li class="toctree-l1"> <a class="" href="../model_zoo/index.html">Model Zoo</a> </li> <li class="toctree-l1"> <a class="" href="../jupyter/index.html">Jupyter notebooks</a> </li> <li class="toctree-l1"> <a class="" href="../design/index.html">Design</a> </li> </ul> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">Neural Network Distiller</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> »</li> <li>Installation</li> <li class="wy-breadcrumbs-aside"> </li> </ul> <hr/> </div> <div role="main"> <div class="section"> <h1 id="distiller-installation">Distiller Installation</h1> <p>These instructions will help get Distiller up and running on your local machine.</p> <p>You may also want to refer to these resources:</p> <ul> <li><a href="https://github.com/NervanaSystems/distiller#set-up-the-classification-datasets">Dataset installation</a> instructions.</li> <li><a href="https://nervanasystems.github.io/distiller/jupyter/index.html#installation">Jupyter installation</a> instructions.</li> </ul> <p>Notes: - Distiller has only been tested on Ubuntu 16.04 LTS, and with Python 3.5. - If you are not using a GPU, you might need to make small adjustments to the code.</p> <h2 id="clone-distiller">Clone Distiller</h2> <p>Clone the Distiller code repository from github:</p> <pre><code>$ git clone https://github.com/NervanaSystems/distiller.git </code></pre> <p>The rest of the documentation that follows, assumes that you have cloned your repository to a directory called <code>distiller</code>. <br></p> <h2 id="create-a-python-virtual-environment">Create a Python virtual environment</h2> <p>We recommend using a <a href="https://docs.python.org/3/library/venv.html#venv-def">Python virtual environment</a>, but that of course, is up to you. There's nothing special about using Distiller in a virtual environment, but we provide some instructions, for completeness.<br> Before creating the virtual environment, make sure you are located in directory <code>distiller</code>. After creating the environment, you should see a directory called <code>distiller/env</code>. <br></p> <h3 id="using-virtualenv">Using virtualenv</h3> <p>If you don't have virtualenv installed, you can find the installation instructions <a href="https://packaging.python.org/guides/installing-using-pip-and-virtualenv/">here</a>.</p> <p>To create the environment, execute:</p> <pre><code>$ python3 -m virtualenv env </code></pre> <p>This creates a subdirectory named <code>env</code> where the python virtual environment is stored, and configures the current shell to use it as the default python environment.</p> <h3 id="using-venv">Using venv</h3> <p>If you prefer to use <code>venv</code>, then begin by installing it:</p> <pre><code>$ sudo apt-get install python3-venv </code></pre> <p>Then create the environment:</p> <pre><code>$ python3 -m venv env </code></pre> <p>As with virtualenv, this creates a directory called <code>distiller/env</code>.<br></p> <h3 id="activate-the-environment">Activate the environment</h3> <p>The environment activation and deactivation commands for <code>venv</code> and <code>virtualenv</code> are the same.<br> <strong>!NOTE: Make sure to activate the environment, before proceeding with the installation of the dependency packages:<br></strong></p> <pre><code>$ source env/bin/activate </code></pre> <h2 id="install-dependencies">Install dependencies</h2> <p>Finally, install Distiller's dependency packages using <code>pip3</code>:</p> <pre><code>$ pip3 install -r requirements.txt </code></pre> <p>PyTorch is included in the <code>requirements.txt</code> file, and will currently download PyTorch version 3.1 for CUDA 8.0. This is the setup we've used for testing Distiller.</p> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="../usage/index.html" class="btn btn-neutral float-right" title="Usage">Next <span class="icon icon-circle-arrow-right"></span></a> <a href="../index.html" class="btn btn-neutral" title="Home"><span class="icon icon-circle-arrow-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <!-- Copyright etc --> </div> Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <div class="rst-versions" role="note" style="cursor: pointer"> <span class="rst-current-version" data-toggle="rst-current-version"> <span><a href="../index.html" style="color: #fcfcfc;">« Previous</a></span> <span style="margin-left: 15px"><a href="../usage/index.html" style="color: #fcfcfc">Next »</a></span> </span> </div> <script>var base_url = '..';</script> <script src="../js/theme.js"></script> <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <script src="../search/require.js"></script> <script src="../search/search.js"></script> </body> </html>