コード例 #1
0
    def export(self,
               export_dir,
               signature_fn=None,
               input_fn=export.default_input_fn,
               default_batch_size=1,
               exports_to_keep=None):
        """Exports inference graph into given dir.

    Args:
      export_dir: A string containing a directory to write the exported graph
        and checkpoints.
      signature_fn: Function that returns a default signature and a named
        signature map, given `Tensor` of `Example` strings, `dict` of `Tensor`s
        for features and `Tensor` or `dict` of `Tensor`s for predictions.
      input_fn: Function that given `Tensor` of `Example` strings, parses it
        into features that are then passed to the model.
      default_batch_size: Default batch size of the `Example` placeholder.
      exports_to_keep: Number of exports to keep.
    """
        export.export_estimator(estimator=self,
                                export_dir=export_dir,
                                signature_fn=signature_fn,
                                input_fn=input_fn,
                                default_batch_size=default_batch_size,
                                exports_to_keep=exports_to_keep)
コード例 #2
0
ファイル: monitors.py プロジェクト: 363158858/tensorflow
 def every_n_step_end(self, step, outputs):
   super(ExportMonitor, self).every_n_step_end(step, outputs)
   try:
     export.export_estimator(self._estimator, self.export_dir,
                             exports_to_keep=self.exports_to_keep)
   except RuntimeError:
     # Currently we are not syncronized with saving checkpoints, which leads to
     # runtime errors when we are calling export on the same global step.
     logging.info("Skipping exporting for the same step. "
                  "Consider exporting less frequently.")
コード例 #3
0
ファイル: monitors.py プロジェクト: zssnyder/tensorflow
 def every_n_step_end(self, step, outputs):
     super(ExportMonitor, self).every_n_step_end(step, outputs)
     try:
         export.export_estimator(self._estimator,
                                 self.export_dir,
                                 exports_to_keep=self.exports_to_keep)
     except RuntimeError:
         # Currently we are not syncronized with saving checkpoints, which leads to
         # runtime errors when we are calling export on the same global step.
         logging.info("Skipping exporting for the same step. "
                      "Consider exporting less frequently.")
コード例 #4
0
ファイル: monitors.py プロジェクト: 10imaging/tensorflow
 def end(self, session=None):
   super(ExportMonitor, self).end(session=session)
   latest_path = saver_lib.latest_checkpoint(self._estimator.model_dir)
   if latest_path is None:
     logging.info("Skipping export at the end since model has not been saved "
                  "yet.")
     return
   export.export_estimator(self._estimator,
                           self.export_dir,
                           exports_to_keep=self.exports_to_keep,
                           signature_fn=self.signature_fn,
                           default_batch_size=self._default_batch_size)
コード例 #5
0
ファイル: monitors.py プロジェクト: Hyhyx/DeepLearning
 def end(self, session=None):
   super(ExportMonitor, self).end(session=session)
   latest_path = saver_lib.latest_checkpoint(self._estimator.model_dir)
   if latest_path is None:
     logging.info("Skipping export at the end since model has not been saved "
                  "yet.")
     return
   export.export_estimator(self._estimator,
                           self.export_dir,
                           exports_to_keep=self.exports_to_keep,
                           signature_fn=self.signature_fn,
                           default_batch_size=self._default_batch_size)
コード例 #6
0
ファイル: estimator.py プロジェクト: billho/tensorflow
  def export(self, export_dir, signature_fn=None,
             input_fn=export.default_input_fn, default_batch_size=1,
             exports_to_keep=None):
    """Exports inference graph into given dir.

    Args:
      export_dir: A string containing a directory to write the exported graph
        and checkpoints.
      signature_fn: Function that returns a default signature and a named
        signature map, given `Tensor` of `Example` strings, `dict` of `Tensor`s
        for features and `Tensor` or `dict` of `Tensor`s for predictions.
      input_fn: Function that given `Tensor` of `Example` strings, parses it
        into features that are then passed to the model.
      default_batch_size: Default batch size of the `Example` placeholder.
      exports_to_keep: Number of exports to keep.
    """
    export.export_estimator(estimator=self,
                            export_dir=export_dir,
                            signature_fn=signature_fn,
                            input_fn=input_fn,
                            default_batch_size=default_batch_size,
                            exports_to_keep=exports_to_keep)
コード例 #7
0
ファイル: monitors.py プロジェクト: zssnyder/tensorflow
 def end(self):
     super(ExportMonitor, self).end()
     export.export_estimator(self._estimator,
                             self.export_dir,
                             exports_to_keep=self.exports_to_keep)
コード例 #8
0
ファイル: monitors.py プロジェクト: umunusb1/AIBotTensorFLow
 def end(self, session=None):
     super(ExportMonitor, self).end(session=session)
     export.export_estimator(self._estimator,
                             self.export_dir,
                             exports_to_keep=self.exports_to_keep,
                             signature_fn=self.signature_fn)
コード例 #9
0
ファイル: monitors.py プロジェクト: Francix/tensorflow
 def end(self, session=None):
   super(ExportMonitor, self).end(session=session)
   export.export_estimator(self._estimator,
                           self.export_dir,
                           exports_to_keep=self.exports_to_keep,
                           signature_fn=self.signature_fn)
コード例 #10
0
ファイル: monitors.py プロジェクト: 363158858/tensorflow
 def end(self):
   super(ExportMonitor, self).end()
   export.export_estimator(self._estimator, self.export_dir,
                           exports_to_keep=self.exports_to_keep)