tensorflow-estimator - 如何修复我的估算器分类器代码
问题描述
嗨,我是 Tensorflow 的新手,我一直在练习 tensorflow.estimator 库。基本上我在下面运行了内置的 tf.estimator.DNNClassifier 算法
import tensorflow as tf
def train_input_fn(features, labels, batch_size):
"""An input function for training"""
# Convert the inputs to a Dataset.
dataset = tf.data.Dataset.from_tensor_slices((dict(features), labels))
# Shuffle, repeat, and batch the examples.
return dataset.shuffle(1000).repeat().batch(batch_size)
# Feature columns describe how to use the input.
my_feature_columns = []
for key in landmark_features.keys():
my_feature_columns.append(tf.feature_column.numeric_column(key=key))
# Build a DNN with 2 hidden layers and 10 nodes in each hidden layer.
classifier = tf.estimator.DNNClassifier(feature_columns=my_feature_columns, hidden_units=[10, 10],n_classes=10)
dataset = train_input_fn(landmark_features, emotion_labels, batch_size = 1375 )
但是我不断收到以下错误:
INFO:tensorflow:Using default config.
WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmpc_tag0rc
INFO:tensorflow:Using config: {'_model_dir': '/tmp/tmpc_tag0rc', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true
graph_options {
rewrite_options {
meta_optimizer_iterations: ONE
}
}
关于我可以做些什么来修复我的代码的任何想法?
解决方案
推荐阅读
- r - Latex 命令突然出现在 rmarkdown pdf 中
- json - 如何使用 JSON 格式发布 ManyToOne 实体
- python - python使用索引从组合数据框中选择单个数据框数据
- excel - 在同一行添加范围声明后不再成功设置范围数组
- reactjs - 如何防止使用 Redux 多次显示相同的错误?
- arrays - Rust:数组长度的宏
- python - Office365-REST-Python-客户端访问令牌问题
- excel - Excel 中的 DATEDIF 和 IF 语句,在 10 个月内不会返回正确的结果
- android - 如何使用 Room 库中的 createFromAsset 函数?
- java - 从静态上下文调用非静态方法