tensorflow - ValidationMonitor triggered only once -
i trying use tensorflow's validationmonitor
on dnnregressor.fit
but gets triggered once when global_step = 1
. how fix it?
the every_n_step
setup 1 this
validation_monitor = tf.contrib.learn.monitors.validationmonitor( test_dataset.data, test_dataset.target, every_n_steps=1) regressor = tf.contrib.learn.dnnregressor(feature_columns=feature_columns, hidden_units=[2], model_dir="/home/maciej/tf-logs") regressor.fit(x=train_dataset.data, y=train_dataset.target, steps=1000, monitors=[validation_monitor])
what on stdout logs loss , single 1 validation:
info:tensorflow:saving dict global step 201: global_step = 201, loss = 5.50003 info:tensorflow:validation (step 201): loss = 5.50003, global_step = 201 info:tensorflow:global_step/sec: 96.1045 info:tensorflow:loss = 6.3935, step = 301 info:tensorflow:global_step/sec: 154.978 info:tensorflow:loss = 4.77587, step = 401 info:tensorflow:global_step/sec: 158.06 info:tensorflow:loss = 3.72956, step = 501 info:tensorflow:global_step/sec: 151.51 info:tensorflow:loss = 3.04578, step = 601
this confirmed on tensorboard.
the full code , logs available here: https://gist.github.com/maciejjaskowski/9f791e517f379c41d20cc72619909fe6
as explained in monitoring tutorial, validationmonitors rely on saved checkpoints.
consider adding checkpoints every x seconds with:
config=tf.contrib.learn.runconfig(save_checkpoints_secs=5)
this worked me.
Comments
Post a Comment