【发布时间】:2018-07-18 08:32:09
【问题描述】:
我想知道是否可以在训练/评估循环中使用函数 tf.graph_util.convert_variables_to_constants(以存储图形的冻结版本),而我正在使用自定义估算器。例如:
best_validation_accuracy = -1
for _ in range(steps // how_often_validation):
# Train the model
estimator.train(input_fn=train_input_fn, steps=how_often_validation)
# Evaluate the model
validation_accuracy = estimator.evaluate(input_fn=eval_input_fn)
# Save best model
if validation_accuracy["accuracy"] > best_validation_accuracy:
best_validation_accuracy = validation_accuracy["accuracy"]
# Save best model perfomances
# I WANT TO USE tf.graph_util.convert_variables_to_constants HERE
【问题讨论】:
标签: python tensorflow tensorflow-estimator