Skip to content

Instantly share code, notes, and snippets.

@priyanlc
Created April 30, 2020 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priyanlc/de3d1aae853cec2b617518af3028f44b to your computer and use it in GitHub Desktop.
Save priyanlc/de3d1aae853cec2b617518af3028f44b to your computer and use it in GitHub Desktop.
run_config = tf.estimator.RunConfig(model_dir=MODEL_DIR, save_summary_steps=4000, save_checkpoints_steps=4000)
estimator = keras.estimator.model_to_estimator(keras_model=model, config=run_config)
train_spec = tf.estimator.TrainSpec(input_fn=input_function(train_df_scaled, train_labels, True),
max_steps=STEPS)
eval_spec = tf.estimator.EvalSpec(input_fn=input_function(validation_df_scaled, validation_labels, True),
steps=1200, throttle_secs=350)
tf.estimator.train_and_evaluate(estimator, train_spec=train_spec, eval_spec=eval_spec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment