## 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.

- [![](http://www.tensorflow.org/static/hub/images/guide_basics.png)](http://www.tensorflow.org/hub/overview.md.txt)

  #### [See the guide](http://www.tensorflow.org/hub/overview.md.txt)

  Learn about how to use TensorFlow Hub and how it works.
- [![](http://www.tensorflow.org/static/site-assets/images/marketing/learn/lite-pick.svg)](http://www.tensorflow.org/hub/tutorials.md.txt)

  #### [See tutorials](http://www.tensorflow.org/hub/tutorials.md.txt)

  Tutorials show you end-to-end examples using TensorFlow Hub.
- [![](http://www.tensorflow.org/static/site-assets/images/marketing/learn/js-run.svg)](https://tfhub.dev)

  #### [See models](https://tfhub.dev)

  Find trained TF, TFLite, and TF.js models for your use case.

## *** ** * ** ***
<br />
Models

Find trained models from the TensorFlow community on [TFHub.dev](https://tfhub.dev) [![](http://www.tensorflow.org/static/hub/images/bert.png)](https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/3)

### [BERT](https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/3)

Check out BERT for NLP tasks including text classification and question answering. [See the model](https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/3) [![](http://www.tensorflow.org/static/hub/images/object_detection.png)](https://tfhub.dev/tensorflow/faster_rcnn/inception_resnet_v2_640x640/1)

### [Object detection](https://tfhub.dev/tensorflow/faster_rcnn/inception_resnet_v2_640x640/1)

Use the Faster R-CNN Inception ResNet V2 640x640 model for detecting objects in images. [See the model](https://tfhub.dev/tensorflow/faster_rcnn/inception_resnet_v2_640x640/1) [![](http://www.tensorflow.org/static/hub/images/style_transfer.png)](https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2)

### [Style transfer](https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2)

Transfer the style of one image to another using the image style transfer model. [See the model](https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2) [![](http://www.tensorflow.org/static/hub/images/food.png)](https://tfhub.dev/google/lite-model/aiy/vision/classifier/food_V1/1)

### [On-device food classifier](https://tfhub.dev/google/lite-model/aiy/vision/classifier/food_V1/1)

Use this TFLite model to classify photos of food on a mobile device. [See the model](https://tfhub.dev/google/lite-model/aiy/vision/classifier/food_V1/1)

## *** ** * ** ***
<br />
News \& announcements

Check out [our blog](https://blog.tensorflow.org/search?label=TensorFlow+Hub) for more announcements and view the latest [#TFHub updates](https://twitter.com/search?q=%23TFHub+from:TensorFlow&src=typed_query&f=live) on Twitter [Video](https://www.youtube.com/watch?v=BE5nkhFe3AE)

### [TensorFlow Hub for Real World Impact at Google I/O](https://www.youtube.com/watch?v=BE5nkhFe3AE)

Learn how you can use TensorFlow Hub to build ML solutions with real world impact. [Watch the video](https://www.youtube.com/watch?v=BE5nkhFe3AE) [![](http://www.tensorflow.org/static/hub/images/odml.png)](https://g.co/on-device-ml)

### [On-device ML solutions](https://g.co/on-device-ml)

To explore ML solutions for your mobile and web apps including TensorFlow Hub, visit the Google on-device machine learning page. [Visit the site](https://g.co/on-device-ml) [![](http://www.tensorflow.org/static/hub/images/bert_preprocess_wide.png)](https://blog.tensorflow.org/2020/12/making-bert-easier-with-preprocessing-models-from-tensorflow-hub.html)

### [Making BERT Easier with Preprocessing Models From TensorFlow Hub](https://blog.tensorflow.org/2020/12/making-bert-easier-with-preprocessing-models-from-tensorflow-hub.html)

TensorFlow Hub makes BERT simple to use with new preprocessing models. [Read the blog](https://blog.tensorflow.org/2020/12/making-bert-easier-with-preprocessing-models-from-tensorflow-hub.html) [![](http://www.tensorflow.org/static/hub/images/spice_blog.png)](https://blog.tensorflow.org/2020/06/estimating-pitch-with-spice-and-tensorflow-hub.html)

### [From singing to musical scores: Estimating pitch with SPICE and Tensorflow Hub](https://blog.tensorflow.org/2020/06/estimating-pitch-with-spice-and-tensorflow-hub.html)

Learn how to use the SPICE model to automatically transcribe sheet music from live audio. [Read the blog](https://blog.tensorflow.org/2020/06/estimating-pitch-with-spice-and-tensorflow-hub.html)

## *** ** * ** ***
<br />
Community

Join the TensorFlow Hub community [![](http://www.tensorflow.org/static/hub/images/github_icon.svg)](https://github.com/tensorflow/hub)

### [TensorFlow Hub on GitHub](https://github.com/tensorflow/hub)

[](http://www.tensorflow.org/hub/publish.md.txt)

### [Contribute models](http://www.tensorflow.org/hub/publish.md.txt)

### [Get started with TensorFlow Hub](https://tfhub.dev)

[Find trained models](https://tfhub.dev)