I get the following warning when running my notebook locally in PyCharm:
~/.pyenv/versions/ai_env/lib/python3.12/site-packages/keras/src/trainers/epoch_iterator.py:151: UserWarning: Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least "steps_per_epoch * epochs" batches. You may need to use the ".repeat()" function when building your dataset.
A web search suggest that it is related to these lines (29-33) inside the windowed_dataset:
# Create batches of windows
dataset = dataset.batch(batch_size)
# Optimize the dataset for training
dataset = dataset.cache().prefetch(1)
In Lab 2 a similar error occurs from this code block:
# Print properties of a single batch
for windows in dataset.take(1):
print(f'data type: {type(windows)}')
print(f'number of elements in the tuple: {len(windows)}')
print(f'shape of first element: {windows[0].shape}')
print(f'shape of second element: {windows[1].shape}')
2025-03-18 19:00:08.381570: W tensorflow/core/kernels/data/cache_dataset_ops.cc:914] The calling iterator did not fully read the dataset being cached. In order to avoid unexpected truncation of the dataset, the partially cached contents of the dataset will be discarded. This can happen if you have an input pipeline similar to `dataset.cache().take(k).repeat()`. You should use `dataset.take(k).cache().repeat()` instead.
2025-03-18 19:00:08.382075: I tensorflow/core/framework/local_rendezvous.cc:405] Local rendezvous is aborting with status: OUT_OF_RANGE: End of sequence
The dataset
being iterated is constructed via the same function code as in Lab 3.
I suspect the same is happening behind the scenes when running the notebook via the web interface the course provides.
My question(s) is:
The warning suggests batching/caching/fetching/taking
are not constructed properly or have an improper sequence or are missing the mentioned repeat()
function. Is their a better way to setup the the dataset
as it pertains batching/caching/fetching/taking
that cures this warning? Where is the proper placement repeat()
function?
–J