Skip to content

Conversation

@lantiga
Copy link
Contributor

@lantiga lantiga commented Apr 2, 2020

TF2 supports freezing models, which can ben ran on TF1.15.

This PR adds a test on a MNIST-like model generated with Keras, exported through TF2 and that is ran on RedisAI.

@lantiga
Copy link
Contributor Author

lantiga commented Apr 2, 2020

@hhsecond you might want to add this use case to your export library

@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #315 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #315   +/-   ##
======================================
  Coverage    57.1%   57.1%           
======================================
  Files          26      26           
  Lines        5133    5133           
======================================
  Hits         2931    2931           
  Misses       2202    2202

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bd2eed...14247f2. Read the comment docs.

@hhsecond
Copy link

hhsecond commented Apr 2, 2020

Awesome. I'll do that. Assuming they have added it in 2.1?
Also, I believe this doesn't mean we can run all 2.x models in 1.15 because there are 2.x specific ops.

I know this because we have built the same functionality using 1.15 earlier. i.e a SavedModel directory from 2.x can be opened using 1.15 and then convert it to frozen model from there. And I had issues converting few models from 2.x to 1.15

@hhsecond
Copy link

hhsecond commented Apr 2, 2020

Maybe with this new utility, they might convert it to a backward-compatible representation? Very unlikely

@lantiga
Copy link
Contributor Author

lantiga commented Apr 2, 2020

This is slightly different though since it's TF2 doing the freezing. Since the frozen model is only useful for running in TF1, I'm expecting TF2 to fail if there's no corresponding op in GraphDef, so at least it would fail early on the TF2 side.
Can we try challenging the freezing?

@hhsecond
Copy link

hhsecond commented Apr 2, 2020

That's a fair point. Let me find the models I tried with the old technique.

@lantiga lantiga merged commit c10c8bb into master Apr 5, 2020
lantiga added a commit that referenced this pull request May 6, 2020
 
Add Keras model test with TF2 model (#315)

* Add MNIST test with tf2 model

* Clean up model generating script for TF2

* Update README with information on Keras and TF2

* Improve TF 2 support description
@gkorland gkorland deleted the tf2_test branch October 6, 2020 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants