【发布时间】:2020-03-24 15:43:26
【问题描述】:
我习惯了自动更新脚本,但仍然遇到一些问题。这个区域似乎是导致问题的部分,任何帮助将不胜感激。
发出错误:“AttributeError: 'BatchDataset' 对象没有属性 'output_types'”
# network parameters
n_hidden_1 = 50
n_hidden_2 = 25
ds_train = tf.data.Dataset.from_tensor_slices((X_placeholder, Y_placeholder)).shuffle(buffer_size=round(len(X_train) * 0.3)).batch(batch_size_placeholder)
ds_test = tf.data.Dataset.from_tensor_slices((X_placeholder, Y_placeholder)).batch(batch_size_placeholder)
ds_iter = tf.compat.v1.data.make_one_shot_iterator(ds_train.output_types, ds_train.output_shapes)
next_x, next_y = ds_iter.get_next()
train_init_op = ds_iter.make_initializer(ds_train)
test_init_op = ds_iter.make_initializer(ds_test)
【问题讨论】:
标签: tensorflow machine-learning neural-network tensorflow2.0