Как изменить default_def по умолчанию с помощью Estimator - PullRequest
1 голос
/ 02 апреля 2019

Как изменить клавишу signature_def при обучении и обслуживании модели, построенной с помощью DNNClassifier Оценщик в Tensorflow?

С помощью инструмента saved_model_cli я вижу значение по умолчанию predict.Я хотел бы изменить это.

Я сохраняю модель для обслуживания с помощью следующей функции:

  def save_serving_model(self,estimator):
      ''' 
      To run a quick check:
      saved_model_cli run --dir /path/to/mode/ --tag_set serve --signature_def predict --input_exprs="Headline=['some text'];Description=['some more text']"
      '''
      feature_placeholder = {'Headline': tf.placeholder('string', [1], name='headline_placeholder'),
        'Description': tf.placeholder('string', [1],name='description_placeholder')}
      serving_input_fn = tf.estimator.export.build_raw_serving_input_receiver_fn(feature_placeholder)
      estimator.export_savedmodel(self.serving_model_name, serving_input_fn)


...