Description
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.
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 tofit()
may also
create variables, so it's a good idea to put yourfit()
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