-
Notifications
You must be signed in to change notification settings - Fork 567
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
Request to Update TensorFlow Import for Compatibility in train.py and test.py Scripts #569
Comments
Could you describe what this would do? We haven't worked with tf v1 for a while and I'm not sure what this is trying to fix. |
Hello, I was working on a study using your GitHub code and encountered an issue with compatibility when running your example Colab notebook with your suggested method. I initially thought the problem was related to model saving, but I managed to resolve that by using a different model-saving approach. However, I continued to encounter unusual errors with your code, which, in my opinion, appeared to be well-structured. After investigating further, I realized that the code was originally implemented using Tensorflow 1.x, which is no longer current. To restore the functionality of the code and fix all errors, including the model saving issue, I found a simple solution: replacing the Tensorflow import commands with import tensorflow.compat.v1 as tf, especially in your train and test TensorFlow scripts. In short, this command allows us to use code originally designed for TensorFlow 1.x while benefiting from the newer TensorFlow versions, which currently is TensorFlow 2.x. I have attached screenshots for your reference. Thanks model.save IssueAdam Optimizer IssueOverall Fix |
Kindly update the import line in your train.py and test.py scripts to use import tensorflow.compat.v1 as tf to mitigate compatibility errors during code execution in TensorFlow 2.x versions.
The text was updated successfully, but these errors were encountered: