Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation discrepancy between Keras and Tensorflow Distributed strategy guides: should fit be inside or outside strategy scope? #2007

Open
seanv507 opened this issue Dec 19, 2024 · 0 comments
Assignees

Comments

@seanv507
Copy link

seanv507 commented Dec 19, 2024

Issue Type

Documentation Bug

Source

source

Keras Version

current master branch

Custom Code

No

OS Platform and Distribution

No response

Python version

No response

GPU model and memory

No response

Current Behavior?

Documentation discrepancy.

https://github.com/keras-team/keras-io/blob/9c3b9b7b1f0ffc20f13833b067925d757b961a42/guides/distributed_training_with_tensorflow.py#L82C1-L86C1

Use the strategy object to open a scope, and within this scope, create all the Keras
objects you need that contain variables. Typically, that means creating & compiling the
model
inside the distribution scope. In some cases, the first call to fit() may also
create variables, so it's a good idea to put your fit() call in the scope as well.

Similarly the code sample on that page has fit within the strategy scope.

https://www.tensorflow.org/guide/keras/distributed_training

Use the strategy object to open a scope, and within this scope, create all the Keras objects you need that contain variables. Typically, that means creating & compiling the model inside the distribution scope.

Similarly the code sample on that page has fit outside the strategy scope.

Standalone code to reproduce the issue or tutorial link

Documentation issue

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants