You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/10/05 18:04:30 UTC

[GitHub] kevinthesun commented on a change in pull request #8063: Add export model

kevinthesun commented on a change in pull request #8063: Add export model
URL: https://github.com/apache/incubator-mxnet/pull/8063#discussion_r143013177
 
 

 ##########
 File path: python/mxnet/module/module.py
 ##########
 @@ -171,6 +174,77 @@ def save_checkpoint(self, prefix, epoch, save_optimizer_states=False):
             self.save_optimizer_states(state_name)
             logging.info('Saved optimizer state to \"%s\"', state_name)
 
+    def export_serving(self, prefix, epoch, signature, save_optimizer_states=False,
+                       use_synset=False):
+        """Export current progress to a zip file used by MXNet model serving.
+
+        Parameters
+        ----------
+        prefix : str
+            The file prefix to export to.
+        epoch : int
+            The current epoch number.
+        signature : dict
+            A dictionary containing model input and output information.
+            Data names or data shapes of inputs and outputs can be automatically
+            collected from module. User needs to specify inputs and outputs MIME
+            type for http request. Currently only 'image/jpeg' and 'application/json'
+            are supported. All inputs should have the same type. This also applies for
+            outputs.
+            An example signature would be:
+                signature = { "input_type": "image/jpeg", "output_type": "application/json" }
+        save_optimizer_states : bool
+            Whether to save optimizer states to continue training.
+        use_synset : bool
 
 Review comment:
   This may be a good chance to refactor this interface. Class label is only for classification task, but this API is a general one for all DL models. For example, users may want to put vocabulary dictionary file into exported model as well. Sometimes they may put multiple files into exported model. My suggestion is we can change this argument to 'util_file', which is a list of files users want exported model to contain. In this way, users can use these files in MMS, though currently only classification label will be automatically loaded.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services