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
wrong calculations with TPU distribution strategy #67301
Comments
@mohammad0081, |
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. |
yes , this issue will accur even with mnist dataset using tpu strategy, accuracy will be random ! i will provide the code soon |
import tensorflow as tf print("All devices: ", tf.config.list_logical_devices('TPU')) def create_model(): model.compile(optimizer = 'sgd', loss = 'sparse_categorical_crossentropy', metrics = ['accuracy']) return model with strategy.scope() : model = create_model() |
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.16.1
Custom code
Yes
OS platform and distribution
colab os platform
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
TPU
Current behavior?
we expected that the training process , would be faster on multiple TPUs rather than single T4 GPU , but the numbers returned from fit() method would be the same . instead, we got faster calculations but whole different numbers returned , such as accuracy and loss significantly decreased after 5 epochs . in GPU , after 5 epochs we get 90+ percent of accuracy on test set , but on TPU mirrored strategy we get 24 % of accuracy on test set and it converges on this range
Standalone code to reproduce the issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: