How to print progress when training DNNClassifier in tensor stream r0.9 (skflow)?

I could not understand that DNNClassifier prints progress during training, i.e. loss assessment and validation. Since I realized that the loss can be printed using a configuration parameter that inherits from BaseEstimator, but when I passed the RunConfig object, the classifier did not print anything.

from tensorflow.contrib.learn.python.learn.estimators import run_config config = run_config.RunConfig(verbose=1) classifier = learn.DNNClassifier(hidden_units=[10, 20, 10], n_classes=3, config=config) classifier.fit(X_train, y_train, steps=1000) 

Am I missing something? I checked how RunConfig handles the detailed parameter, and it seems that it only cares that there are more than 1 , which does not correspond to the documentation:

verbose: Controls detail, possible values: 0: algorithm and debugging information are disabled. 1: coach prints progress. 2: the device log is printed.

Regarding the validation assessment, I thought using monitors. ValidationMonitor will be just fine, but when you try it, the classifier does not print anything, and nothing happens when you try to use early_stopping_rounds. I am looking for documentation or some comments in the source code, but I could not find them for monitors.

+6
source share
1 answer

Adding these parameters to the matching function shows progress:

 import logging logging.getLogger().setLevel(logging.INFO) 

Example:

 INFO:tensorflow:global_step/sec: 0 INFO:tensorflow:Training steps [0,1000000) INFO:tensorflow:Step 1: loss = 10.5043 INFO:tensorflow:training step 100, loss = 10.45380 (0.223 sec/batch). INFO:tensorflow:Step 101: loss = 10.5623 INFO:tensorflow:training step 200, loss = 10.46701 (0.220 sec/batch). INFO:tensorflow:Step 201: loss = 10.3885 INFO:tensorflow:training step 300, loss = 10.36501 (0.232 sec/batch). INFO:tensorflow:Step 301: loss = 10.3441 INFO:tensorflow:training step 400, loss = 10.44571 (0.220 sec/batch). INFO:tensorflow:Step 401: loss = 10.396 INFO:tensorflow:global_step/sec: 3.95 
+8
source

All Articles