Commit 05d1c6b9 authored by 宋柯's avatar 宋柯

模型上线

parent 848ce3b9
......@@ -241,7 +241,13 @@ train_dataset = input_fn(DATA_DIR + 'train_samples.csv', 1, True, 2048)
eval_dataset = input_fn(DATA_DIR + 'eval_samples.csv', 1, False, 2 ** 15)
train_spec = tf.estimator.TrainSpec(input_fn = lambda: train_dataset, hooks = hooks)
def train_dataset_input_fn(train_dataset):
return train_dataset
def eval_dataset_input_fn(eval_dataset):
return eval_dataset
train_spec = tf.estimator.TrainSpec(input_fn = lambda: train_dataset_input_fn(train_dataset), hooks = hooks)
serving_feature_spec = tf.feature_column.make_parse_example_spec(
linear_feature_columns + dnn_feature_columns)
......@@ -255,7 +261,7 @@ exporter = tf.estimator.BestExporter(
serving_input_receiver_fn = serving_input_receiver_fn,
exports_to_keep = 1)
eval_spec = tf.estimator.EvalSpec(input_fn = lambda: eval_dataset, steps = None, throttle_secs = 120, exporters = exporter)
eval_spec = tf.estimator.EvalSpec(input_fn = lambda: eval_dataset_input_fn(eval_dataset), steps = None, throttle_secs = 120, exporters = exporter)
# def my_auc(labels, predictions):
# return {'auc_pr_careful_interpolation': tf.metrics.auc(labels, predictions['logistic'], curve='ROC',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment