Questions tagged [tensorflow-hub]

TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models. A module is a self-contained piece of a TensorFlow graph, along with its weights and assets, that can be reused across different tasks in a process known as transfer learning.

TensorFlow Hub modules contain variables that have been pre-trained for a task using a large dataset. By reusing a module on a related task, you can train a model with a smaller dataset, improve generalization, or significantly speed up training.

Please see tensorflow.org/hub for more information.

326 questions
23
votes
4 answers

SavedModel file does not exist when using Tensorflow hub

When trying to use the hub.load function from tensorflow_hub, I get an OSError: SavedModel file does not exist at: error. The weird thing is that it worked a few days ago, so I don't quite understand why I'm getting this error now. Code to…
Kevin Sun
  • 1,171
  • 2
  • 8
  • 17
23
votes
3 answers

Can a TensorFlow Hub module be used in TensorFlow 2.0?

I tried running this code in TensorFlow 2.0 (alpha): import tensorflow_hub as hub @tf.function def elmo(texts): elmo_module = hub.Module("https://tfhub.dev/google/elmo/2", trainable=True) return elmo_module(texts, signature="default",…
MiniQuark
  • 46,633
  • 36
  • 147
  • 183
14
votes
1 answer

How to serve a tensorflow-module, specifically Universal Sentence Encoder?

I have spent several hours trying to set up Tensorflow serving of the Tensorflow-hub module, "Universal Sentence Encoder." There is a similar question here: How to make the tensorflow hub embeddings servable using tensorflow serving? I have been…
11
votes
1 answer

ModuleNotFoundError: No module named 'tensorflow_hub'

I followed instructions given in the TensorFlow website to install tensorflow_hub and installed it within a conda environment. $ pip install "tensorflow>=2.0.0" $ pip install --upgrade tensorflow-hub I ran the above in anaconda prompt But I'm…
11
votes
1 answer

tensorflow_hub throwing this error: 'SentencepieceOp' when loading the link

The following line of code I am trying to run in PyCharm and I have tensorflow_hub installed and imported. use = hub.load("https://tfhub.dev/google/universal-sentence-encoder-multilingual-large/3") Any suggestions for the below error? As I need…
jonnb104
  • 119
  • 1
  • 6
11
votes
6 answers

How to save/load a tensorflow hub module to/from a custom path?

The tensorflow_hub library maintainers has made it every easy for users to download and use the pre-trained tensorflow modules, e.g.: import tensorflow_hub as hub embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder/1") But from…
alvas
  • 115,346
  • 109
  • 446
  • 738
9
votes
4 answers

Cannot load tensorflow_hub

after writing import tensorflow_hub, the following error emerges: class LatestModuleExporter(tf.estimator.Exporter): AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'Exporter' I'm using python 3.6 with tensorflow…
Gal Hyams
  • 336
  • 1
  • 5
  • 15
8
votes
4 answers

Is there any way to access layers in tensorflow_hub.KerasLayer object?

I am trying to use a pre-trained model from tensorflow hub into my object detection model. I wrapped a model from hub as a KerasLayer object following the official instruction. Then I realized that I cannot access the layers in this pre-trained…
8
votes
2 answers

Error on Scope Variable While Using Tensorflow Hub

I am using Colab to run a text analysis code. I am want to get universal-sentence-encoder-large from tensorflow_hub. But anytime running the block containing the code below: module =…
pouria babvey
  • 145
  • 2
  • 12
8
votes
3 answers

How to fix "RuntimeError: Missing implementation that supports: loader" when calling hub.text_embedding_column method?

I'm trying to fit a text classification model. Therefore i wanted to use the text_embedding_column function provided by tensorflow-hub. Unfortunately i get a runtime error import tensorflow_hub as hub embedded_text_feature_column =…
Con
  • 89
  • 2
  • 8
7
votes
2 answers

Any way to extract the exhaustive vocabulary of the google universal sentence encoder large?

I have some sentences for which I am creating an embedding and it works great for similarity searching unless there are some truly unusual words in the sentence. In that case, the truly unusual words in fact contain the very most similarity…
Steve Madere
  • 509
  • 3
  • 9
6
votes
3 answers

I have this error when trying to import tensorflow_hub: cannot import name 'parameter_server_strategy_v2' from 'tensorflow.python.distribute'

I ran this code: import tensorflow_hub as hub I got this error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last)
Yannick Pezeu
  • 530
  • 1
  • 7
  • 12
6
votes
1 answer

Swap gnews with ELMo in the simple colab tutorial

I'm working on this colab notebook: https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/tf2_text_classification.ipynb I'd like to replace the gnews swivel embeddings with the ELMo embeddings. So, replace model =…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
6
votes
1 answer

Tensorflow Hub : Stuck while importing a model

Trying to import some models with Tensorflow Hub with this code : import tensorflow as tf import tensorflow_hub as hub elmo_model = hub.Module('https://tfhub.dev/google/elmo/2', trainable=True) Makes my notebook stuck. The only log line appearing…
Astariul
  • 2,190
  • 4
  • 24
  • 41
5
votes
1 answer

How to fine tune a pre-trained GAN?

I would like to fine tune a pre-trained GAN available online using my own images. For example, BigGAN, which was trained on ImageNet, can generate realistic images. However, I do not want to generate the classes of images in ImageNet. I want to…
1
2 3
21 22