简体   繁体   English

Keras Model 中无限数据集的 steps_per_epoch 和 validation_steps

[英]steps_per_epoch and validation_steps for infinite Dataset in Keras Model

I have a huge dataset of csv files having a volume of around 200GB.我有一个包含 csv 个文件的庞大数据集,文件大小约为 200GB。 I don't know the total number of records in the dataset.我不知道数据集中的记录总数。 I'm using make_csv_dataset to create a PreFetchDataset generator.我正在使用make_csv_dataset创建一个 PreFetchDataset 生成器。

I'm facing problem when Tensorflow complains to specify steps_per_epoch and validation_steps for infinite dataset....当 Tensorflow 抱怨为无限数据集指定 steps_per_epoch 和 validation_steps 时,我遇到了问题....

  1. How can I specify the steps_per_epoch and validation_steps?如何指定 steps_per_epoch 和 validation_steps?

  2. Can I pass these parameters as the percentage of total dataset size?我可以将这些参数作为总数据集大小的百分比传递吗?

  3. Can I somehow avoid these parameters as I want my whole dataset to be iterated for each epoch?我可以以某种方式避免这些参数,因为我希望我的整个数据集在每个时期都被迭代吗?

I think this SO thread answer the case when we know to total number of data records in advance.我认为当我们提前知道数据记录总数时, 这个 SO线程会回答这种情况。

Here is a screenshot from documentation.这是文档的屏幕截图。 But I'm not getting it properly.但我没有得到正确的。 截屏

What does the last line mean?最后一行是什么意思?

I see no other option than iterating through your entire dataset.除了遍历整个数据集,我看不到其他选择。

ds = tf.data.experimental.make_csv_dataset('myfile.csv', batch_size=16, num_epochs=1)

for ix, _ in enumerate(ds, 1):
    pass

print('The total number of steps is', ix)

Don't forget the num_epochs argument.不要忘记num_epochs参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Keras Model 中 steps_per_epoch 和 validation_steps 的行为 - Behavior of steps_per_epoch and validation_steps in Keras Model 如何在 Keras 中正确设置 steps_per_epoch 和 validation_steps? - How to properly set steps_per_epoch and validation_steps in Keras? 了解fit_generator(steps_per_epoch),validation_steps,evaluate_generator(步骤)和predict_generator(步骤) - Understanding fit_generator (steps_per_epoch), validation_steps, evaluate_generator (Steps) & predict_generator (steps) TF keras API 与 TF 数据集问题-steps_per_epoch 参数问题 - TF keras API with TF dataset problem - steps_per_epoch argument problem fit_generator中的Keras steps_per_epoch如何工作 - How the Keras steps_per_epoch in fit_generator works TensorFlow keras 模型 fit() 参数 steps_per_epoch 和训练集上的 epochs 行为 - TensorFlow keras model fit() parameters steps_per_epoch and epochs behavior on train set Keras model.fit()引发关于未指定参数`steps_per_epoch`的错误 - Keras model.fit() Raises Error About Unspecified Parameter `steps_per_epoch` Keras Sequence,fit_generator和steps_per_epoch - Keras Sequence, fit_generator and steps_per_epoch Keras 2 fit_generator UserWarning:`steps_per_epoch`与Keras 1参数`samples_per_epoch`不同 - Keras 2 fit_generator UserWarning: `steps_per_epoch` is not the same as the Keras 1 argument `samples_per_epoch` 仅使用batch_size 和仅使用steps_per_epoch 的Keras model.fit 之间的区别 - Difference between Keras model.fit using only batch_size and using only steps_per_epoch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM