tf.compat.v1.data.make_initializable_iterator
Stay organized with collections
Save and categorize content based on your preferences.
Creates an iterator for elements of dataset
.
tf.compat.v1.data.make_initializable_iterator(
dataset: tf.compat.v1.data.Dataset
,
shared_name=None
) -> tf.compat.v1.data.Iterator
Caution: This API was designed for TensorFlow v1.
Continue reading for details on how to migrate from this API to a native
TensorFlow v2 equivalent. See the
TensorFlow v1 to TensorFlow v2 migration guide
for instructions on how to migrate the rest of your code.
This is a legacy API for consuming dataset elements and should only be used
during transition from TF 1 to TF 2. Note that using this API should be
a transient state of your code base as there are in general no guarantees
about the interoperability of TF 1 and TF 2 code.
In TF 2 datasets are Python iterables which means you can consume their
elements using for elem in dataset: ...
or by explicitly creating iterator
via iterator = iter(dataset)
and fetching its elements via
values = next(iterator)
.
Description
Note: The returned iterator will be in an uninitialized state,
and you must run the iterator.initializer
operation before using it: dataset = ...
iterator = tf.compat.v1.data.make_initializable_iterator(dataset)
# ...
sess.run(iterator.initializer)
Args
dataset
A tf.data.Dataset
.
shared_name
(Optional.) If non-empty, the returned iterator will be shared
under the given name across multiple sessions that share the same devices
(e.g. when using a remote server).
Raises
RuntimeError
If eager execution is enabled.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license .
Last updated 2024-01-23 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-01-23 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-23 UTC."]]