title: Sagemaker "Could not find model data" when trying to deploy my model
body: <p>I have a training script in Sagemaker like,</p>
  
  <pre><code>def train(current_host, hosts, num_cpus, num_gpus, channel_input_dirs, model_dir, hyperparameters, **kwargs):
      ... Train a network ...
      return net
  
  def save(net, model_dir):
      # save the model
      logging.info('Saving model')
      y = net(mx.sym.var('data'))
      y.save('%s/model.json' % model_dir)
      net.collect_params().save('%s/model.params' % model_dir)
  
  def model_fn(model_dir):
      symbol = mx.sym.load('%s/model.json' % model_dir)
      outputs = mx.symbol.softmax(data=symbol, name='softmax_label')
      inputs = mx.sym.var('data')
      param_dict = gluon.ParameterDict('model_')
      net = gluon.SymbolBlock(outputs, inputs, param_dict)
      net.load_params('%s/model.params' % model_dir, ctx=mx.cpu())
      return net
  </code></pre>
  
  <p>Most of which I stole from the <a href="https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-sdk/mxnet_gluon_mnist/mnist.py" rel="nofollow noreferrer">MNIST Example</a>.</p>
  
  <p>When I train, everything goes fine, but when trying to deploy like,</p>
  
  <pre><code>m = MXNet("lstm_trainer.py", 
            role=role, 
            train_instance_count=1, 
            train_instance_type="ml.c4.xlarge",
            hyperparameters={'batch_size': 100, 
                           'epochs': 20, 
                           'learning_rate': 0.1, 
                           'momentum': 0.9, 
                           'log_interval': 100})
  m.fit(inputs) # No errors
  predictor = m.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge')
  </code></pre>
  
  <p>I get, (<a href="https://gist.github.com/aidan-plenert-macdonald/7eb7ba7402790b61596938b5cbf605b6" rel="nofollow noreferrer">full output</a>)</p>
  
  <pre><code>INFO:sagemaker:Creating model with name: sagemaker-mxnet-py2-cpu-2018-01-17-20-52-52-599
  ---------------------------------------------------------------------------
    ... Stack dump ...
  ClientError: An error occurred (ValidationException) when calling the CreateModel operation: Could not find model data at s3://sagemaker-us-west-2-01234567890/sagemaker-mxnet-py2-cpu-2018-01-17-20-52-52-599/output/model.tar.gz.
  </code></pre>
  
  <p>Looking in my S3 bucket <code>s3://sagemaker-us-west-2-01234567890/sagemaker-mxnet-py2-cpu-2018-01-17-20-52-52-599/output/model.tar.gz</code>, I in fact don't see the model.</p>
  
  <p>What am I missing?</p>