blob: 9534e12973a1945cb7f9de1fa28ab8a8ad844fc3 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<title>Frequently Asked Questions — mxnet documentation</title>
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="../_static/basic.css" rel="stylesheet" type="text/css">
<link href="../_static/pygments.css" rel="stylesheet" type="text/css">
<link href="../_static/mxnet.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: ''
};
</script>
<script src="../_static/jquery-1.11.1.js" type="text/javascript"></script>
<script src="../_static/underscore.js" type="text/javascript"></script>
<script src="../_static/searchtools_custom.js" type="text/javascript"></script>
<script src="../_static/doctools.js" type="text/javascript"></script>
<script src="../_static/selectlang.js" type="text/javascript"></script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-96378503-1', 'auto');
ga('send', 'pageview');
</script>
<!-- -->
<!-- <script type="text/javascript" src="../_static/jquery.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../_static/underscore.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="../_static/doctools.js"></script> -->
<!-- -->
<!-- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -->
<!-- -->
<link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"/>
</link></link></head>
<body role="document"><!-- Previous Navbar Layout
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="../" class="navbar-brand">
<img src="http://data.mxnet.io/theme/mxnet.png">
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="navbar" class="navbar navbar-left">
<li> <a href="../get_started/index.html">Get Started</a> </li>
<li> <a href="../tutorials/index.html">Tutorials</a> </li>
<li> <a href="../how_to/index.html">How To</a> </li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Packages <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../packages/python/index.html">
Python
</a></li>
<li><a href="../packages/r/index.html">
R
</a></li>
<li><a href="../packages/julia/index.html">
Julia
</a></li>
<li><a href="../packages/c++/index.html">
C++
</a></li>
<li><a href="../packages/scala/index.html">
Scala
</a></li>
<li><a href="../packages/perl/index.html">
Perl
</a></li>
</ul>
</li>
<li> <a href="../system/index.html">System</a> </li>
<li>
<form class="" role="search" action="../search.html" method="get" autocomplete="off">
<div class="form-group inner-addon left-addon">
<i class="glyphicon glyphicon-search"></i>
<input type="text" name="q" class="form-control" placeholder="Search">
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form> </li>
</ul>
<ul id="navbar" class="navbar navbar-right">
<li> <a href="../index.html"><span class="flag-icon flag-icon-us"></span></a> </li>
<li> <a href="..//zh/index.html"><span class="flag-icon flag-icon-cn"></span></a> </li>
</ul>
</div>
</div>
</div>
Previous Navbar Layout End -->
<div class="navbar navbar-fixed-top">
<div class="container" id="navContainer">
<div class="innder" id="header-inner">
<h1 id="logo-wrap">
<a href="../" id="logo"><img src="http://data.mxnet.io/theme/mxnet.png"/></a>
</h1>
<nav class="nav-bar" id="main-nav">
<a class="main-nav-link" href="../get_started/install.html">Install</a>
<a class="main-nav-link" href="../tutorials/index.html">Tutorials</a>
<a class="main-nav-link" href="../how_to/index.html">How To</a>
<span id="dropdown-menu-position-anchor">
<a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a>
<ul class="dropdown-menu" id="package-dropdown-menu">
<li><a class="main-nav-link" href="../api/python/index.html">Python</a></li>
<li><a class="main-nav-link" href="../api/scala/index.html">Scala</a></li>
<li><a class="main-nav-link" href="../api/r/index.html">R</a></li>
<li><a class="main-nav-link" href="../api/julia/index.html">Julia</a></li>
<li><a class="main-nav-link" href="../api/c++/index.html">C++</a></li>
<li><a class="main-nav-link" href="../api/perl/index.html">Perl</a></li>
</ul>
</span>
<a class="main-nav-link" href="../architecture/index.html">Architecture</a>
<!-- <a class="main-nav-link" href="../community/index.html">Community</a> -->
<a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a>
<span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Versions(master)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/>v0.10.14</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/versions/0.10/index.html>0.10</a></li><li><a class="main-nav-link" href=http://mxnet.incubator.apache.org/test/versions/master/index.html>master</a></li></ul></span></nav>
<script> function getRootPath(){ return "../" } </script>
<div class="burgerIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"></a>
<ul class="dropdown-menu dropdown-menu-right" id="burgerMenu">
<li><a href="../get_started/install.html">Install</a></li>
<li><a href="../tutorials/index.html">Tutorials</a></li>
<li><a href="../how_to/index.html">How To</a></li>
<li class="dropdown-submenu">
<a href="#" tabindex="-1">API</a>
<ul class="dropdown-menu">
<li><a href="../api/python/index.html" tabindex="-1">Python</a>
</li>
<li><a href="../api/scala/index.html" tabindex="-1">Scala</a>
</li>
<li><a href="../api/r/index.html" tabindex="-1">R</a>
</li>
<li><a href="../api/julia/index.html" tabindex="-1">Julia</a>
</li>
<li><a href="../api/c++/index.html" tabindex="-1">C++</a>
</li>
<li><a href="../api/perl/index.html" tabindex="-1">Perl</a>
</li>
</ul>
</li>
<li><a href="../architecture/index.html">Architecture</a></li>
<li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li>
<li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(master)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/>v0.10.14</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/versions/0.10/index.html>0.10</a></li><li><a tabindex="-1" href=http://mxnet.incubator.apache.org/test/versions/master/index.html>master</a></li></ul></li></ul>
</div>
<div class="plusIcon dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a>
<ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul>
</div>
<div id="search-input-wrap">
<form action="../search.html" autocomplete="off" class="" method="get" role="search">
<div class="form-group inner-addon left-addon">
<i class="glyphicon glyphicon-search"></i>
<input class="form-control" name="q" placeholder="Search" type="text"/>
</div>
<input name="check_keywords" type="hidden" value="yes">
<input name="area" type="hidden" value="default"/>
</input></form>
<div id="search-preview"></div>
</div>
<div id="searchIcon">
<span aria-hidden="true" class="glyphicon glyphicon-search"></span>
</div>
<!-- <div id="lang-select-wrap"> -->
<!-- <label id="lang-select-label"> -->
<!-- <\!-- <i class="fa fa-globe"></i> -\-> -->
<!-- <span></span> -->
<!-- </label> -->
<!-- <select id="lang-select"> -->
<!-- <option value="en">Eng</option> -->
<!-- <option value="zh">中文</option> -->
<!-- </select> -->
<!-- </div> -->
<!-- <a id="mobile-nav-toggle">
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
</a> -->
</div>
</div>
</div>
<div class="container">
<div class="row">
<div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api/python/index.html">Python Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/r/index.html">R Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/julia/index.html">Julia Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/c++/index.html">C++ Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/scala/index.html">Scala Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../api/perl/index.html">Perl Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html">HowTo Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">System Documents</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/index.html">Tutorials</a></li>
</ul>
</div>
</div>
<div class="content">
<div class="section" id="frequently-asked-questions">
<span id="frequently-asked-questions"></span><h1>Frequently Asked Questions<a class="headerlink" href="#frequently-asked-questions" title="Permalink to this headline"></a></h1>
<p>This topic provides answers to the frequently asked questions on <a class="reference external" href="https://github.com/dmlc/mxnet/issues">mxnet/issues</a>. Before posting an issue, please check this page. If you would like to contribute to this page, please make the questions and answers simple. If your answer is extremely detailed, please post it elsewhere and link to it.</p>
<div class="section" id="building-and-installation">
<span id="building-and-installation"></span><h2>Building and Installation<a class="headerlink" href="#building-and-installation" title="Permalink to this headline"></a></h2>
<p>You can find answers to most questions the <a class="reference external" href="http://mxnet.io/get_started/setup.html">build page</a>.</p>
</div>
<div class="section" id="speed">
<span id="speed"></span><h2>Speed<a class="headerlink" href="#speed" title="Permalink to this headline"></a></h2>
<div class="section" id="it-took-a-long-time-to-start-running-on-a-gpu">
<span id="it-took-a-long-time-to-start-running-on-a-gpu"></span><h3>It took a long time to start running on a GPU<a class="headerlink" href="#it-took-a-long-time-to-start-running-on-a-gpu" title="Permalink to this headline"></a></h3>
<p>Try to disable opencv to use a GPU: <a class="reference external" href="http://mxnet.io/get_started/setup.html#build-opencv-from-source-code">build opencv from source with GPU module disabled</a>.</p>
</div>
<div class="section" id="it-s-slow-on-a-single-gpu">
<span id="it-s-slow-on-a-single-gpu"></span><h3>It’s slow on a single GPU<a class="headerlink" href="#it-s-slow-on-a-single-gpu" title="Permalink to this headline"></a></h3>
<p>Check the following:</p>
<ol class="simple">
<li>Ensure that your CUDA/driver version is not too old.</li>
<li>Build with <code class="docutils literal"><span class="pre">USE_CUDNN=1</span></code>. This often increases speed 50+%. Try to use the newest version.</li>
<li>Set <code class="docutils literal"><span class="pre">export</span> <span class="pre">MXNET_CUDNN_AUTOTUNE_DEFAULT=1</span></code> before running. This often increases speed 10%-15%.</li>
<li>If you are using Tesla GPUs by <code class="docutils literal"><span class="pre">nvidia-smi</span> <span class="pre">-e</span> <span class="pre">0</span></code>, disable ECC. You might need root permission and have to reboot.</li>
<li>For Tesla cards by <code class="docutils literal"><span class="pre">nvidia-smi</span> <span class="pre">-ac</span> <span class="pre">??</span></code>, set to the maximal clock. For details, see <a class="reference external" href="https://devblogs.nvidia.com/parallelforall/increase-performance-gpu-boost-k80-autoboost/">this blog</a>.</li>
<li>No throttle reason <code class="docutils literal"><span class="pre">nvidia-smi</span> <span class="pre">-q</span> <span class="pre">-d</span> <span class="pre">PERFORMANCE</span></code> is often caused by temperature.</li>
</ol>
</div>
<div class="section" id="no-increase-in-speed-when-using-more-than-one-gpu-or-computer">
<span id="no-increase-in-speed-when-using-more-than-one-gpu-or-computer"></span><h3>No increase in speed when using more than one GPU or computer<a class="headerlink" href="#no-increase-in-speed-when-using-more-than-one-gpu-or-computer" title="Permalink to this headline"></a></h3>
<p>Check the following:</p>
<ol class="simple">
<li>Does your neural network already run fast, such as >1000 example/sec or >10 batches/sec? If yes, it’s unlikely to speed up any further by adding more resources because of the communication overhead.</li>
<li>Are you using a small batch size? Try to increase it.</li>
<li>Are you using more than 4 GPUs? Try using <code class="docutils literal"><span class="pre">--kv-store=device</span></code>.</li>
</ol>
</div>
</div>
<div class="section" id="memory-usage">
<span id="memory-usage"></span><h2>Memory Usage<a class="headerlink" href="#memory-usage" title="Permalink to this headline"></a></h2>
<div class="section" id="abnormal-cpu-memory-usage">
<span id="abnormal-cpu-memory-usage"></span><h3>Abnormal CPU memory usage<a class="headerlink" href="#abnormal-cpu-memory-usage" title="Permalink to this headline"></a></h3>
<p>This might be due to the data pre-fetch. See <a class="reference external" href="https://github.com/dmlc/mxnet/issues/2111">issue 2111</a>.</p>
</div>
</div>
<div class="section" id="pending-review">
<span id="pending-review"></span><h2>Pending Review<a class="headerlink" href="#pending-review" title="Permalink to this headline"></a></h2>
<p>The following topics need to be reviewed.</p>
<div class="section" id="how-to-copy-part-of-parameters-to-another-model">
<span id="how-to-copy-part-of-parameters-to-another-model"></span><h3>How to Copy Part of Parameters to Another Model<a class="headerlink" href="#how-to-copy-part-of-parameters-to-another-model" title="Permalink to this headline"></a></h3>
<p>Most MXNet model consists two parts, the argument arrays and symbol. You can simply copy the argument array to the argument array of another model. For example, in the Python model API, you can do this:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">copied_model</span> <span class="o">=</span> <span class="n">mx</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">FeedForward</span><span class="p">(</span><span class="n">ctx</span><span class="o">=</span><span class="n">mx</span><span class="o">.</span><span class="n">gpu</span><span class="p">(),</span> <span class="n">symbol</span><span class="o">=</span><span class="n">new_symbol</span><span class="p">,</span>
<span class="n">arg_params</span><span class="o">=</span><span class="n">old_arg_params</span><span class="p">,</span> <span class="n">aux_params</span><span class="o">=</span><span class="n">old_aux_params</span><span class="p">,</span>
<span class="n">allow_extra_params</span><span class="o">=</span><span class="bp">True</span><span class="p">);</span>
</pre></div>
</div>
<p>For information about copying model parameters from an existing <code class="docutils literal"><span class="pre">old_arg_params</span></code>, see this <a class="reference external" href="https://github.com/dmlc/mxnet-notebooks/blob/master/python/how_to/predict.ipynb">notebook</a>. More notebooks please refer to <a class="reference external" href="https://github.com/dmlc/mxnet-notebooks">dmlc/mxnet-notebooks</a>.</p>
</div>
<div class="section" id="how-to-extract-the-feature-map-of-a-certain-layer">
<span id="how-to-extract-the-feature-map-of-a-certain-layer"></span><h3>How to Extract the Feature Map of a Certain Layer<a class="headerlink" href="#how-to-extract-the-feature-map-of-a-certain-layer" title="Permalink to this headline"></a></h3>
<p>See this <a class="reference external" href="https://github.com/dmlc/mxnet-notebooks/blob/master/python/how_to/predict.ipynb">notebook</a>. More notebooks please refer to <a class="reference external" href="https://github.com/dmlc/mxnet-notebooks">dmlc/mxnet-notebooks</a>.</p>
</div>
<div class="section" id="what-is-the-relationship-between-mxnet-and-cxxnet-minerva-and-purine2">
<span id="what-is-the-relationship-between-mxnet-and-cxxnet-minerva-and-purine2"></span><h3>What Is the Relationship Between MXNet and CXXNet, Minerva, and Purine2?<a class="headerlink" href="#what-is-the-relationship-between-mxnet-and-cxxnet-minerva-and-purine2" title="Permalink to this headline"></a></h3>
<p>MXNet is created in collaboration by authors from the three projects.
MXNet reflects what we have learned from these projects.
It combines the important aspects of the existing projects: general efficiency, flexibility, and memory efficiency.</p>
<p>MXNet also contains new approaches that allow you to combine different
ways of programming and write CPU/GPU applications that are more
memory efficient than CXXNet and Purine, and more flexible than Minerva.</p>
</div>
<div class="section" id="what-is-the-relationship-between-mxnet-and-tensorflow">
<span id="what-is-the-relationship-between-mxnet-and-tensorflow"></span><h3>What Is the Relationship Between MXNet and TensorFlow?<a class="headerlink" href="#what-is-the-relationship-between-mxnet-and-tensorflow" title="Permalink to this headline"></a></h3>
<p>Both MXNet and <a class="reference external" href="https://www.tensorflow.org/">TensorFlow</a> use computation graph abstraction, which was initially used by Theano, then adopted by other packages, such as CGT, Caffe2, and Purine. Currently, TensorFlow adopts an optimized symbolic API. MXNet supports a <a class="reference external" href="https://mxnet.io/architecture/program_model.html">mixed approach</a>, with a dynamic dependency scheduler to combine symbolic and imperative programming.
In short, MXNet is lightweight and <em>mixed</em> with flexibility from imperative programming, while using a computation graph to make it very fast and memory efficient.</p>
</div>
</div>
</div>
<div class="container">
<div class="footer">
<p> © 2015-2017 DMLC. All rights reserved. </p>
</div>
</div>
</div>
<div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Frequently Asked Questions</a><ul>
<li><a class="reference internal" href="#building-and-installation">Building and Installation</a></li>
<li><a class="reference internal" href="#speed">Speed</a><ul>
<li><a class="reference internal" href="#it-took-a-long-time-to-start-running-on-a-gpu">It took a long time to start running on a GPU</a></li>
<li><a class="reference internal" href="#it-s-slow-on-a-single-gpu">It’s slow on a single GPU</a></li>
<li><a class="reference internal" href="#no-increase-in-speed-when-using-more-than-one-gpu-or-computer">No increase in speed when using more than one GPU or computer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#memory-usage">Memory Usage</a><ul>
<li><a class="reference internal" href="#abnormal-cpu-memory-usage">Abnormal CPU memory usage</a></li>
</ul>
</li>
<li><a class="reference internal" href="#pending-review">Pending Review</a><ul>
<li><a class="reference internal" href="#how-to-copy-part-of-parameters-to-another-model">How to Copy Part of Parameters to Another Model</a></li>
<li><a class="reference internal" href="#how-to-extract-the-feature-map-of-a-certain-layer">How to Extract the Feature Map of a Certain Layer</a></li>
<li><a class="reference internal" href="#what-is-the-relationship-between-mxnet-and-cxxnet-minerva-and-purine2">What Is the Relationship Between MXNet and CXXNet, Minerva, and Purine2?</a></li>
<li><a class="reference internal" href="#what-is-the-relationship-between-mxnet-and-tensorflow">What Is the Relationship Between MXNet and TensorFlow?</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div> <!-- pagename != index -->
<script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="../_static/js/sidebar.js" type="text/javascript"></script>
<script src="../_static/js/search.js" type="text/javascript"></script>
<script src="../_static/js/navbar.js" type="text/javascript"></script>
<script src="../_static/js/clipboard.min.js" type="text/javascript"></script>
<script src="../_static/js/copycode.js" type="text/javascript"></script>
<script type="text/javascript">
$('body').ready(function () {
$('body').css('visibility', 'visible');
});
</script>
</div></body>
</html>