本文介绍了没有简单的方法将Tensorboard输出添加到预定义的估算器函数DnnClassifier吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在TF 1.3中使用estimator接口,包括创建数据输入功能:

I have been using the estimator interface in TF 1.3 including the creation of the data input function:

training_input_fn = tf.estimator.inputs.pandas_input_fn(x=training_data, y=training_label, batch_size=64, shuffle=True, num_epochs=None)

并构建NN:

dnnclassifier = tf.estimator.DNNClassifier( feature_columns=dnn_features, hidden_units=[1024, 500, 100], n_classes=2, model_dir='./tmp/ccsprop', optimizer=tf.train.ProximalAdagradOptimizer( learning_rate=0.001, l1_regularization_strength=0.01 ))

dnnclassifier = tf.estimator.DNNClassifier( feature_columns=dnn_features, hidden_units=[1024, 500, 100], n_classes=2, model_dir='./tmp/ccsprop', optimizer=tf.train.ProximalAdagradOptimizer( learning_rate=0.001, l1_regularization_strength=0.01 ))

并执行它

dnnclassifier.train(input_fn=training_input_fn, steps=1500)

经过大量搜索后,我发现没有简单的方法来添加张量板输出,而无需重新创建模型,并在此处指示 https://www.tensorflow.org/extend/estimators

After much searching I see no easy way to add tensorboard output without resorting to recreating the model from scratch and indicated here https://www.tensorflow.org/extend/estimators

即使这样,我也找不到很好的例子来遵循,它们都创建了一个带有tensorboard输出的简单dnnClassifier.有指导吗?

And even then I can find no good examples to follow that both create a simple dnnClassifier with tensorboard output. any guidance?

我有基本模型,但需要更仔细地检查它,以便最终也可以使用实验进行调整.没看到吗?

I have the basic model working but need to examine it much more closely for tuning eventually using experiments as well. Don't see how?

推荐答案

有关GH的扩展讨论,请参见此处: https://github.com/tensorflow/tensorflow/issues/12974#issuecomment-339856673

See here for an extended discussion on GH: https://github.com/tensorflow/tensorflow/issues/12974#issuecomment-339856673

这是从罐装模型中获取全套TB输出的窍门:

This does the trick to get a full set of TB output from canned models:

dnnclassifier = tf.estimator.DNNClassifier(
  feature_columns=dnn_features,
  hidden_units=[1024, 500, 100],
  n_classes=2, 
  model_dir='./tmp/ccsprop',
  optimizer=tf.train.ProximalAdagradOptimizer(
    learning_rate=0.001,
    l1_regularization_strength=0.01),
  config=tf.estimator.RunConfig().replace(save_summary_steps=10)
)

注意最后一行,并注意需要括号的地方!

Note the last line and be observant of where you need parentheses!

这篇关于没有简单的方法将Tensorboard输出添加到预定义的估算器函数DnnClassifier吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 20:04