-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bug fix: Saving problem with TF2 SavedModel fmt in TensorflowTransform class. #5797
Bug fix: Saving problem with TF2 SavedModel fmt in TensorflowTransform class. #5797
Conversation
…'t save the TensorFlow SavedModel directory in the repo. It was just done for frozen graphs. It was missing for the SavedModel format.
…avedModelPath) while saving frozen graphs.
Codecov Report
@@ Coverage Diff @@
## main #5797 +/- ##
========================================
Coverage 68.35% 68.36%
========================================
Files 1131 1131
Lines 241210 241372 +162
Branches 25039 25055 +16
========================================
+ Hits 164887 165011 +124
- Misses 69819 69857 +38
Partials 6504 6504
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@darth-vader-lg this looks great! Thanks for taking the time to submit this. Can you add a unit test around this new saving/loading? |
Hello @michaelgsharp, |
…). Signed-off-by: darth-vader-lg <luigi.generale@gmail.com>
Hello @michaelgsharp, The unit test is added: TensorFlowSaveAndLoadSavedModel. It does the following steps:
Check if it's all ok for You and have a good merge. |
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. Thanks!
The SaveModel function of the TensorflowTransform class didn't save the TensorFlow saved_model directory in the zip repo. It was just done for frozen graphs but missing for the SavedModel format.
I followed the schema that you used for the DnnRetrainTransform class to fix it:
machinelearning/src/Microsoft.ML.Vision/DnnRetrainTransform.cs
Lines 68 to 75 in 43c49f6
and
machinelearning/src/Microsoft.ML.Vision/DnnRetrainTransform.cs
Lines 701 to 726 in 43c49f6
The same part was not present in the TensorflowTransform class. Just the frozen graph saving:
machinelearning/src/Microsoft.ML.TensorFlow/TensorflowTransform.cs
Lines 425 to 467 in 43c49f6
It leads to an incomplete zip repo that cannot be reloaded after.
After this fix the zip repo can be saved and loaded for inference.
saved_model.pb.zip