[[["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-05-07 UTC."],[],[],null,["# mediapipe_model_maker.model_util.get_steps_per_epoch\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/mediapipe/blob/master/mediapipe/model_maker/python/core/utils/model_util.py#L93-L122) |\n\nGets the estimated training steps per epoch.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`mediapipe_model_maker.face_stylizer.face_stylizer.face_stylizer_options.model_opt.loss_functions.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch), [`mediapipe_model_maker.face_stylizer.face_stylizer.loss_functions.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch), [`mediapipe_model_maker.face_stylizer.face_stylizer.model_opt.loss_functions.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch), [`mediapipe_model_maker.face_stylizer.face_stylizer.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch), [`mediapipe_model_maker.face_stylizer.face_stylizer_options.model_opt.loss_functions.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch), [`mediapipe_model_maker.face_stylizer.model_options.loss_functions.model_util.get_steps_per_epoch`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/get_steps_per_epoch)\n\n\u003cbr /\u003e\n\n mediapipe_model_maker.model_util.get_steps_per_epoch(\n steps_per_epoch: Optional[int] = None,\n batch_size: Optional[int] = None,\n train_data: Optional[../../mediapipe_model_maker/model_util/dataset/Dataset] = None\n ) -\u003e int\n\n1. If `steps_per_epoch` is set, returns `steps_per_epoch` directly.\n2. Else if we can get the length of training data successfully, returns `train_data_length // batch_size`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|--------------------------------|\n| `steps_per_epoch` | int, training steps per epoch. |\n| `batch_size` | int, batch size. |\n| `train_data` | training data. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Estimated training steps per epoch. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|-----------------------------------------------------|\n| `ValueError` | if both steps_per_epoch and train_data are not set. |\n\n\u003cbr /\u003e"]]