title: How to save a model when using MXnet
body: <p>I am using MXnet for training a CNN (in R) and I can train the model without any error with the following code:</p>
  
  <pre><code>model &lt;- mx.model.FeedForward.create(symbol=network,
                                       X=train.iter,
                                       ctx=mx.gpu(0),
                                       num.round=20,
                                       array.batch.size=batch.size,
                                       learning.rate=0.1,
                                       momentum=0.1,  
                                       eval.metric=mx.metric.accuracy,
                                       wd=0.001,
                                       batch.end.callback=mx.callback.log.speedometer(batch.size, frequency = 100)
      )
  </code></pre>
  
  <p>But as this process is time-consuming, I run it on a server during the night and I want to save the model for the purpose of using it after finishing the training.</p>
  
  <p>I used:</p>
  
  <pre><code>save(list = ls(), file="mymodel.RData")
  </code></pre>
  
  <p>and </p>
  
  <pre><code>mx.model.save("mymodel", 10)
  </code></pre>
  
  <p>But none of them can save the model! for example when I load the <code>"mymodel.RData"</code>, I can not predict the labels for the test set!</p>
  
  <p>Another example is when I load the <code>"mymodel.RData"</code> and try to plot it with the following code:</p>
  
  <pre><code>graph.viz(model$symbol$as.json())
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Error in model$symbol$as.json() : external pointer is not valid
  </code></pre>
  
  <p>Can anybody give me a solution for saving and then loading this model for future use?</p>
  
  <p>Thanks</p>