-
Notifications
You must be signed in to change notification settings - Fork 207
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
Updated Keras and TensorFlow. #1174
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
I will add code changes for the remaining Keras workspace - Keras_cnn_with_compression and keras_nlp. @teoparvanov @kta-intel @psfoley, I was facing an issue with optimizer weights due to resetting the weights before saving them to the tensor database and using them to rebuild the model, which resulted in no improvement in accuracy. I have skipped the rebuild (and hence resetting the model optimizer weights) for the first round. This can be further discussed, and we can proceed with these changes once all the pipelines are working and the workspace changes are also completed. |
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall. A couple of questions came up during my read-through:
@@ -60,7 +60,7 @@ def rebuild_model(self, round_num, input_tensor_dict, validation=False): | |||
""" | |||
if self.opt_treatment == "RESET": | |||
self.reset_opt_vars() | |||
self.set_tensor_dict(input_tensor_dict, with_opt_vars=False) | |||
self.set_tensor_dict(input_tensor_dict, with_opt_vars=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intuitively, if the opt treatment is "RESET", shouldn't we have with_opt_vars=False
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done as when optmizers weights are reset. Leraning rate is zero and model accuracy remiains around ~0.125.
Signed-off-by: yes <[email protected]>
@@ -22,10 +22,10 @@ jobs: | |||
|
|||
steps: | |||
- uses: actions/checkout@v3 | |||
- name: Set up Python 3.8 | |||
- name: Set up Python 3.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the task_runner_e2e.yaml workflow as well. It runs nightly so not failed for the PR.
@@ -22,10 +22,10 @@ jobs: | |||
|
|||
steps: | |||
- uses: actions/checkout@v3 | |||
- name: Set up Python 3.8 | |||
- name: Set up Python 3.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If 3.8 not supported anymore, change the README documents as well for the same.
from tensorflow.keras.layers import Conv2D | ||
from tensorflow.keras.layers import Dense | ||
from tensorflow.keras.layers import Flatten | ||
from keras.models import Sequential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tensorflow Keras is still evident and we see many examples in the ML community for the same.
Shouldn't we add separate workspace for Keras 3.0 for now and remove this eventually.
Or we are saying that we are not going to support tensorflow keras anymore.
@@ -17,8 +18,8 @@ | |||
|
|||
with catch_warnings(): | |||
simplefilter(action="ignore") | |||
import keras as ke | |||
import tensorflow as tf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally tensorflow must not be used with Keras as Keras implementation must be free of any backend while running.
Please find the alternative for the same.
Signed-off-by: yes <[email protected]>
Related issue #973.
Changes in this PR:
Workspaces:
This PR will be merged after all the workspaces mentioned above are working.