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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
64 views

Tensorflow saved_model loading issue in version 2.7

I am trying to load a model that was exported to saved_model format using tensorflow version 2.10. Now I need to load that saved model in tensorflow 2.7. This is a requirement since I need to run the ...
Hammad Ali's user avatar
0 votes
0 answers
7 views

facing issue in changing the name of tensor in tensorboard projector?

I am facing issue while changing the name of tensorboard projector, the name of tensor is defined here in the code but config = projector.ProjectorConfig() embedding = config.embeddings.add() ...
Gagan Mehta's user avatar
0 votes
0 answers
21 views

Error inputs and shape of tensor hub while feature extraction

I am doing a process of feature extraction, by loading CenteNet from tf hub. However, I am facing the issue that when trying to fit the model I get the error of a requested tensor with different shape ...
enriquegv001's user avatar
0 votes
1 answer
44 views

TensorFlow saved_model.pb cannot be loaded correctly

I have downloaded a model from Hub. The archive contains TensorFlow 2 saved model and if decompressed shows a file named saved_model.pb and a variables folder that inside has 2 files variables.data-...
AndreaF's user avatar
  • 12.1k
0 votes
0 answers
24 views

universal sentence encoder batch pipeline failing

I have a batch job on DataFlow runner to calculate the embedding from the input text. Through the journey of pipeline. I am using tft.impl.context and impl.AnalyzeAndTransformDataset for the same Here ...
Akarsh Jain's user avatar
0 votes
0 answers
24 views

HOw I properly install and import TensorFlow-hub without errors

I tried to install TensorFlow-hub, but when I try to import it through the below command import tensorflow_hub as hub I face the below error. ImportError: cannot import name 'estimator_export' from '...
Khaled Loulou's user avatar
0 votes
0 answers
12 views

Tensorflow_hub-Output tensors of a Functional model must be the output of a TensorFlow `Layer` . Found: <tensorflow_hub.keras_layer.KerasLayer object>

When trying to transfer learn from a prebuilt model on tensorflow hub i have tried putting it into a model within the functional model API due to its dictionary input. However when doing this it seems ...
Luke Isham's user avatar
0 votes
1 answer
72 views

Why is Tensorflow Hub giving 403 Error suddenly?

Created a project almost a year ago that uses TensorFlow models. All has been working fine up until this morning. Suddenly our application has started getting errors to fetch models at the following ...
pj_qb's user avatar
  • 1
0 votes
1 answer
41 views

tensorflow hub in flutter_android

I want to use the model food_V1, https://tfhub.dev/google/aiy/vision/classifier/food_V1/1 in Flutter, but when I download the model, there is no labels.txt file. There is only one tflite file and I ...
martin Hm's user avatar
0 votes
1 answer
149 views

Tensorflow-Hub Modules not loading

I am trying to use the universal sentence encoder 4, It works on my desktop at home but I am not home so I am having to re-set everything up. I am using this all in a virtual environment. I have ...
Zor's user avatar
  • 1
0 votes
1 answer
92 views

miniconda3 -> Jupyter -> tensorflow-hub -> [SSL: CERTIFICATE_VERIFY_FAILED]

When I try to load a model from tensorflow hub like: INPUT_SHAPE = [None, IMG_SIZE, IMG_SIZE, 3] OUTPUT_SHAPE = len(unique_labels) MODEL_URL = "https://tfhub.dev/google/imagenet/...
DjoleDMonke's user avatar
0 votes
0 answers
64 views

Comparing two Google text embedding models

I'm comparing two models for use in a prototype project: sentence-t5 base and LEALLA. There are a few things that I'm interested in: Speed. Which one is faster? Even the smallest LEALLA model is ...
Aadish Verma's user avatar
0 votes
0 answers
25 views

Tensorflow hub pretrained model error while creating a functional model

I am new to tensorflow and trying to build a model using Functional API and pretrained models from tensorflow hub. The code that I am running is below: import os import tensorflow as tf from ...
DumbCoder's user avatar
  • 247
0 votes
1 answer
94 views

TypeError: 'AutoTrackable' object is not callable when loading BERT module from TF Hub

In my code I wish to create a tokenizer from a pretrained TF Hub BERT module. Following is my code: sess = tf.compat.v1.Session() bert_path = "https://tfhub.dev/google/bert_uncased_L-12_H-768_A-...
inquisitiveForPython's user avatar
1 vote
0 answers
39 views

convert Tensorflow Hub model to TF Lite

I tried to convert a model downloaded from tensorflow hub: faster_rcnn/openimages_v4/inception_resnet_v2 to TF Lite without success. This model interests me in particular because it has been trained ...
nelson mundaca's user avatar
0 votes
0 answers
91 views

Converting jax function with multiple arguments to TensorFlow keras layer fails

This works perfectly: def f_jax(x): return jnp.sin(jnp.cos(x)) f_tf = jax2tf.convert(f_jax, polymorphic_shapes=["(batch, _)"]) f_tf = tf.function(f_tf, autograph=False) f_tf = f_tf....
galah92's user avatar
  • 3,681
0 votes
1 answer
147 views

How to decode token ids into words?

The text preprocessing models on the hub describe how to convert an input sentence, like "I am a boy", into token ids. But it does not show me how to convert those token ids back into words. ...
David S.'s user avatar
  • 10.7k
1 vote
1 answer
172 views

AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'monitoring'

Recently installed tensorflow and tensorflow_hub in a miniconda environment and have an issue when trying to run a script. Receive the following error: Traceback (most recent call last): File "/...
BeginnersMindTruly's user avatar
0 votes
1 answer
237 views

Convert a model from tf_hub to onnx using tf2onnx

I downloaded a model from tensorflow hub, and then tried to convert it into onnx using tf2onnx (https://github.com/onnx/tensorflow-onnx). However the model does not seem to work properly after ...
Montparg's user avatar
0 votes
1 answer
43 views

Yamnet TF_hub - No algorithm worked CUDNN_STATUS_EXECUTION_FAILED

I defined a yamnet model of tensorflow 2 tensorflow_hub: yamnet_model = hub.load('https://tfhub.dev/google/yamnet/1') wav_data, sample_rate = librosa.load(wav_file_name, sr=16000) scores, spectogram =...
l12's user avatar
  • 91
0 votes
0 answers
56 views

how to extract trillsson output with frame data

I want to extract trillsson output which is published by tensorflow(https://tfhub.dev/google/nonsemantic-speech-benchmark/trillsson5/1). I want to extract time-series embeddings, but according to this ...
wangzhu's user avatar
0 votes
0 answers
143 views

Exception encountered when calling layer "feature_extraction_layer" (type KerasLayer). : downloading a model from tensorflow hub

I want create a model from tensorflow hub but when I try to load the model. I am getting following error. enter image description here `# lets create a model function from tensorflow.keras import ...
Nachiket Upadhye's user avatar
0 votes
0 answers
136 views

How to evaluate MoveNet.SinglePose.Lightning using COCOEval API?

I’m trying to evaluate MoveNet.SinglePose.Lightning using the COCOEval API. However, I do not know how to calculate the score to use for evaluation. Referring to the Results Format page, one score ...
ozwis's user avatar
  • 1
0 votes
0 answers
243 views

Fine tuning MoViNet-A2-Stream Tensorflow-Hub model

import tensorflow as tf import tensorflow_hub as hub hub_url = "https://tfhub.dev/tensorflow/movinet/a2/stream/kinetics-600/classification/3" encoder = hub.KerasLayer(hub_url, trainable=...
Nithin's user avatar
  • 11
1 vote
0 answers
112 views

How to read files in parallel with tf.data.Dataset.from_generator?

I have successfully created a TF dataset using tf.data.Dataset.from_generator that reads several binary files in sequence and converts them to strings. The code looks like this: my_dataset = tf.data....
niefpaarschoenen's user avatar
0 votes
1 answer
46 views

Why does estimator.export_saved_model complain about missing variables after TF2 migration?

I'm doing distillation with a teacher and student BERT model and exporting the student model with estimator.export_saved_model. This worked fine in TF1, but I moved to TF2 to be able to use multi-gpu ...
niefpaarschoenen's user avatar
0 votes
1 answer
99 views

How to manage model file, when load more than 2 models downloading mannually from Tensorflow Hub?

I tried to download model from the url It showed error: URLError: <urlopen error [Errno 101] Network is unreachable> and solved this problem with How to load TF hub model from local system But ...
Jimmy Wang's user avatar
3 votes
2 answers
407 views

Problems with tensorflow_hub in google Collab

I'm trying to play with BERT in Google Collab and import tensorflow_hub as hub but it raising ValueError: The name 'tf.TrackableConstant' has already been registered to a serializable class. Found: &...
Denis Kuznetsov's user avatar
0 votes
0 answers
25 views

with `with strategy.scope():` BERT output loses it's shape from tf-hub and `encoder_output` is missing

Code: !pip install tensorflow-text==2.7.0 import tensorflow_text as text import tensorflow_hub as hub # ... other tf imports.... strategy = tf.distribute.MirroredStrategy() print('Number of GPU: ' + ...
Maifee Ul Asad's user avatar
0 votes
1 answer
193 views

NotFoundError using BERT Preprocessing from TFHub

I'm trying to use the pre-trained BERT models on TensorFlow Hub to do some simple NLP. I'm on a 2021 MacBook Pro (Apple Silicon) with Python 3.9.13 and TensorFlow v2.9.2. However, preprocessing any ...
Joseph Yu's user avatar
0 votes
1 answer
270 views

Why is the validation accuracy low even though I'm using a pretrained model?

I am trying to classify 10 species of birds on google colab using a pretrained model from tensorflow hub which has been trained on 964 species of birds. But when I train it, the accuracy isn't as high ...
adria's user avatar
  • 15
2 votes
1 answer
1k views

ValueError: When input_signature is provided, all inputs to the Python function must be convertible to tensors:

I have pyspark df like this: id desc 1 abd hdbh jbj 2 sgjhd jhdgh gjhg 3 bvj hvhgvgh 4 jkjb bhj Now I want to convert my desc column to vector so I'm using Google sentence ...
Chris_007's user avatar
  • 853
1 vote
2 answers
277 views

Tensorflow Hub Loaded Model - ValueError: Signature specifies 343 arguments, got: 342

I'm passing a Numpy array, image, to 'process_image'. It is then processed, turned into a TensorSpec object with the dimensions and dtype required by the Tensorflow Hub model. def image_preprocessing(...
AxelOJD's user avatar
0 votes
1 answer
143 views

fine-tune the model from TensorFlow Hub

I have used this code from the TensorFlow website: https://www.tensorflow.org/tutorials/images/transfer_learning_with_hub I have to implement the entire code without any problem, but I am wondering ...
Osama Mohammed's user avatar
0 votes
1 answer
550 views

Issue Using tensorflow hub Universal Sentence Encoder with local runtime and GPU in Google Colab

I am working through a machine learning course to learn tensorflow. In one of the project I was performing text classification using a tensorflow_hub pre trained embedding, the Universal sentence ...
user3321208's user avatar
0 votes
1 answer
39 views

How to avoid outputting a auto generated directory when downloading tensorflow hub module

Code: import os path = "https://tfhub.dev/google/universal-sentence-encoder-multilingual/3" + "?tf-hub-format=compressed" os.environ["TFHUB_CACHE_DIR"] = '/...
madst's user avatar
  • 93
1 vote
0 answers
88 views

How to make observation a string in custom PyEnvironment

In the tensorflow documentation for TF-Agents Environments there is an example of an environment for a simple (blackjack inspired) card game. The __init__ looks like the following: class CardGameEnv(...
flowerboy's user avatar
0 votes
1 answer
1k views

tensorflow hub example throws an error when Float16 is enabled

I am trying to load a model from Tensorflowhub using example code. It works perfect with the FP32. As soon as I add the tf.keras.mixed_precision.set_global_policy('mixed_float16') to enable mixed ...
learner's user avatar
  • 2,614
0 votes
1 answer
25 views

Running TF Hub Model sfaster by transfer learning?

I have a project where I want to detect humans from images. I have implemented the code so that I use pre-trained TF Hub Models that are available at: https://github.com/tensorflow/models/blob/master/...
cangozpi's user avatar
  • 109
1 vote
0 answers
408 views

RoBERTa example from tfhub produces error "During Variant Host->Device Copy: non-DMA-copy attempted of tensor type: string"

I would like to use the roberta-base model from tfhub. I am trying to run the example below, although I get an error when I try to feed sentences to model as input. I get the following error Invalid ...
Jane Sully's user avatar
  • 3,177
0 votes
1 answer
90 views

Error while working on chatbot-universal-sentence-encoder

I am trying "chatbot.py" and I am getting below error. Traceback (most recent call last): File "chatbot.py", line 11, in embeddings = model(df["MESSAGE"].values)["...
chetan cc's user avatar
0 votes
1 answer
325 views

How to use tensorflow hub in Azure ML

I am trying to use TensorFlow Hub in Azure ML Studio I am using the kernel Python 3.8 PT and TF And I installed a few modules: !pip install bert-for-tf2 !pip install sentencepiece !pip install "...
Luis Valencia's user avatar
0 votes
1 answer
306 views

Error while creating a model for binary classification for text classification

code: model = create_model() model.compile(optimize=tf.keras.optimizers.Adam(learning_rate=2e-5), loss=tf.keras.losses.BinaryCrossentropy(), metrics=[tf.keras.metrics....
Sai teja Palachuri's user avatar
1 vote
1 answer
1k views

How to load a model using Tensorflow Hub and make a prediction?

This should be a simple task: Download a model saved in tensorflow_hub format, load using tensorflow_hub, and use.. This is the model I am trying to use (simCLR stored in Google Cloud): https://...
hirschme's user avatar
  • 804
0 votes
1 answer
546 views

Yamnet audio classification for feature extraction

I am currently working on audio classification task and using Yamnet which is a pretrained model from tfhub.. I am using it to extract embeddings from audios and then i use another simple ...
khaoula benali's user avatar
0 votes
0 answers
3k views

Can't open .tflite file downloaded from TensorFlow hub

I'm trying to download a style transfer model, and I want to get style bottlenecks from a bunch of images. Here's the code, which I sourced from this site. style_predict_path = tf.keras.utils.get_file(...
Xhatahx's user avatar
2 votes
1 answer
269 views

Why some TensorFlow-Hub models are not fine tunable?

I am just learning image classification with TensorFlow and found that there is a TensorFlow hub where we can use a lot of models for a lot of classification tasks. For example, I want to build food ...
Hermawan Wiwid's user avatar
0 votes
1 answer
180 views

tensorflow: doesn't appear to be using GPU for compute

I have downloaded and am using a tensorflow hub model. The model creation code is: model_url = "https://tfhub.dev/google/imagenet/mobilenet_v3_large_075_224/feature_vector/5" # "https:/...
Ian Newson's user avatar
  • 7,749
0 votes
1 answer
135 views

Creating appropriate dataset for tensorflow multilabel classification model: "ValueError: setting an array element with a sequence"

I'm trying to train a multiclass image classification model, based on this model: https://tfhub.dev/google/imagenet/inception_v3/feature_vector/5 And taking some code from here: https://colab.research....
Ian Newson's user avatar
  • 7,749
0 votes
1 answer
566 views

BERT encodings from TensorFlow hub

I am using the following code to generate embeddings for my text classification. import tensorflow as tf import tensorflow_hub as hub import tensorflow_text as text bert_preprocess =hub.KerasLayer(&...
Para's user avatar
  • 1

1
2 3 4 5
7