TensorFlow Hub is a repository of trained machine learning models.

  !pip install --upgrade tensorflow_hub

  import tensorflow_hub as hub

  model = hub.KerasLayer("https://tfhub.dev/google/nnlm-en-dim128/2")
  embeddings = model(["The rain in Spain.", "falls",
                      "mainly", "In the plain!"])

  print(embeddings.shape)  #(4,128)
TensorFlow Hub is a repository of trained machine learning models ready for fine-tuning and deployable anywhere. Reuse trained models like BERT and Faster R-CNN with just a few lines of code.


Find trained models from the TensorFlow community on tfhub.dev
Check out BERT for NLP tasks including text classification and question answering.
Use the Faster R-CNN Inception ResNet V2 640x640 model for detecting objects in images.
Transfer the style of one image to another using the image style transfer model.
Use this TFLite model to classify photos of food on a mobile device.

News & announcements

Check out our blog for more announcements and view the latest #TFHub updates on Twitter
Learn how to use the SPICE model to automatically transcribe sheet music from live audio.
Use the BiT model for training state-of-the-art custom image classifiers.
Learn about how to use TensorFlow Hub to find models for your use case.