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
tensorflow 1.x and 2.x produce different results during inferencing based on the same parameters #66212
Comments
@jamesYu365 Could you have a look at the TensorFlow Compatibility Checker to identify deprecated or removed operations from your TensorFlow 1.x model. The tool suggests alternative operations for migration. Thank you! |
Hello, thank you for your prompt response. Following your instructions, I added compat.v1 when importing the TensorFlow-related modules:
The result now is the same between two versions. |
@jamesYu365 Using compat.v1 likely mitigated the issue by forcing TF2 to use a more TF1-like behavior, potentially including non-deterministic behavior. This might have made the results from both versions more comparable. |
Thank you for your prompt response again. I'm still puzzled by the non-deterministic behavior you mentioned, considering that all the parameters and inputs are fixed. Where did this non-deterministic behavior come from? Could you please elaborate more on it? Perhaps you could provide some links related to this question, as I'm new to using TensorFlow. Thanks. |
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
tf 1.15 and tf 2.13
Custom code
Yes
OS platform and distribution
Windows
Mobile device
No response
Python version
3.8
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
None
GPU model and memory
None
Current behavior?
I trained a LSTM in Tensorflow1.15, then load the saved model parameters on Tensorflow2.13, the prediction is significantly different from Tensorflow1.15.
Standalone code to reproduce the issue
https://drive.google.com/file/d/1spHn4waDE3vNQzslA7AD06E0XQ1i-qL_/view?usp=sharing
Relevant log output
No response
The text was updated successfully, but these errors were encountered: