【发布时间】:2020-07-29 16:33:28
【问题描述】:
我刚刚更新到 TF-2.3。在使用tf.data.Dataset.from_tensor_slices 作为数据源的模型中,我收到以下警告:
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/multi_device_iterator_ops.py:601: get_next_as_optional (from tensorflow.python.data.ops.iterator_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.data.Iterator.get_next_as_optional()` instead.
我没有在文档中找到有关如何使用更新方法的说明。
train_dataset = tf.data.Dataset.from_tensor_slices(
(
{"input_1": x1_train,
"input_2": x2_train},
{"output": y_train},
)
)
train_batches = train_dataset.batch(GLOBAL_BATCH_SIZE)
培训:
history = model.fit(
x = train_batches,
epochs=30,
verbose = 1,
)
提前致谢。
【问题讨论】:
-
我认为问题是来自 TF 的内部调用,在官方在线指南的示例中也出现了此警告。
标签: python tensorflow keras tensorflow2.0