Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Add an easy way to run a script for a few steps only#21217

Merged
fchollet merged 1 commit intokeras-team:masterfrom
mattdangerw:debug-caps
May 19, 2025
Merged

Add an easy way to run a script for a few steps only#21217
fchollet merged 1 commit intokeras-team:masterfrom
mattdangerw:debug-caps

Conversation

@mattdangerw
Copy link
Member

@mattdangerw mattdangerw commented Apr 28, 2025

I've wanted this tool for a while, figured I should just propose it. Often I need to test out a script or colab I did not write, and just want to run a few train steps without for every fit call without finding every call to fit in the script. This adds a debugging tool to do just that.

KERAS_MAX_EPOCHS=1 KERAS_MAX_STEPS_PER_EPOCH=5 python train.py

@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 82.57%. Comparing base (cbb3682) to head (e926510).

Files with missing lines Patch % Lines
keras/api/_tf_keras/keras/config/__init__.py 0.00% 4 Missing ⚠️
keras/src/backend/config.py 77.77% 2 Missing and 2 partials ⚠️
keras/src/trainers/epoch_iterator.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21217      +/-   ##
==========================================
- Coverage   82.57%   82.57%   -0.01%     
==========================================
  Files         564      564              
  Lines       54629    54677      +48     
  Branches     8495     8502       +7     
==========================================
+ Hits        45108    45147      +39     
- Misses       7432     7438       +6     
- Partials     2089     2092       +3     
Flag Coverage Δ
keras 82.38% <81.25%> (-0.01%) ⬇️
keras-jax 63.63% <62.50%> (-0.01%) ⬇️
keras-numpy 58.74% <37.50%> (-0.02%) ⬇️
keras-openvino 33.01% <33.33%> (+<0.01%) ⬆️
keras-tensorflow 64.04% <58.33%> (-0.01%) ⬇️
keras-torch 63.70% <60.41%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mattdangerw mattdangerw marked this pull request as ready for review April 28, 2025 18:43
@mattdangerw mattdangerw requested a review from fchollet April 28, 2025 18:49
I've wanted this tool for a while, figured I should just propose it.
Often I need to test out a script or colab I did not write, and just
want to run a few train steps without for every fit call without
finding every call to fit in the script. This adds a debugging tool
to do just that.

```
KERAS_MAX_EPOCHS=1 KERAS_MAX_STEPS=5 python train.py
```
@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels May 19, 2025
@fchollet fchollet merged commit e19a2ed into keras-team:master May 19, 2025
9 of 10 checks passed
@google-ml-butler google-ml-butler bot removed awaiting review ready to pull Ready to be merged into the codebase kokoro:force-run labels May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants