This problem is about how to iterate over a TF Dataset given that make_initializable_iterator()
is deprecated.
I read a data set with the function below
It is not very clear what you want to get at your output. If you want to get the values of the dataset output you should execute eagerly. Example:
tf.compat.v1.enable_eager_execution()
def read_dataset_new(filename, target='delay'):
ds = tf.data.TFRecordDataset(filename)
ds = ds.map(lambda buf: parse(buf, target=target))
ds = ds.batch(1)
return ds
# This should return your key values for each example.
for features, labels in read_dataset_new(self.tf_rcrds_fl_nm):
features_keys = features.keys()
# This should return your tensor values if they supposed to be numeric.
for features, labels in read_dataset_new(self.tf_rcrds_fl_nm):
features_array = numpy.array(features)