Can A TensorFlow Hub Module Be Used In TensorFlow 2.0?


Answer :

In Tensorflow 2.0 you should be using hub.load() or hub.KerasLayer().

[April 2019] - For now only Tensorflow 2.0 modules are loadable via them. In the future many of 1.x Hub modules should be loadable as well.

For the 2.x only modules you can see examples in the notebooks created for the modules here


this function load will work with tensorflow 2

embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder-large/3") 

instead of

embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder-large/3") 

[this is not accepted in tf2] use hub.load()


Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?