tensorflow-hub

SavedModel file does not exist when using Tensorflow hub

六眼飞鱼酱① 提交于 2021-01-28 19:35:41
问题 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 reproduce: import tensorflow as tf import tensorflow_hub as hub URL = 'https://tfhub.dev/google/universal-sentence-encoder/4' embed = hub.load(URL) Specific error received: OSError Traceback (most recent call last) <ipython-input-11-dfb80f0299b2> in

Difference between Keras and TensorFlow Hub Version of MobileNetV2

可紊 提交于 2021-01-28 09:50:32
问题 I am working on a transfer learning approach and got very different results when using the MobileNetV2 from keras.applications and the one available on TensorFlow Hub. This seems strange to me as both versions claim here and here to extract their weights from the same checkpoint mobilenet_v2_1.0_224. This is how the differences can be reproduced, you can find the Colab Notebook here: !pip install tensorflow-gpu==2.1.0 import tensorflow as tf import numpy as np import tensorflow_hub as hub

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

依然范特西╮ 提交于 2021-01-28 03:21:13
问题 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 model . But I need to use outputs from some specific layers to build my model. Is there any way to access layers in tensorflow_hub.KerasLayer object? 回答1: For one to be able to do that easily, the creator of the pretrained model would have needed to

Tensorflow 2 Hub: How can I obtain the output of an intermediate layer?

橙三吉。 提交于 2021-01-27 23:54:54
问题 I am trying to implement following network Fots for Text detection using the new tensorflow 2. The authors use the resnet as the backbone of their network, so my first thought was to use the tensoflow hub resnet for loading a pretrained network. But the problem is that i can not find a way to print the summary of the module, which is loaded from tfhub? Is there any way to see the layers of the loaded modules from tf-hub? Thanks Update Unfortunately is the resnet not available for tf2-hub, so

Tensorflow SavedModel ignoring Assets File on Load

独自空忆成欢 提交于 2021-01-24 07:13:26
问题 I fine-tuned a BERT model from Tensorflow hub to build a simple sentiment analyzer. The model trains and runs fine. On export, I simply used: tf.saved_model.save(model, export_dir='models') And this works just fine.. until I reboot. On a reboot, the model no longer loads. I've tried using a Keras loader as well as the Tensorflow Server, and I get the same error. I get the following error message: Not found: /tmp/tfhub_modules/09bd4e665682e6f03bc72fbcff7a68bf879910e/assets/vocab.txt; No such

Tensorflow SavedModel ignoring Assets File on Load

爷,独闯天下 提交于 2021-01-24 07:11:46
问题 I fine-tuned a BERT model from Tensorflow hub to build a simple sentiment analyzer. The model trains and runs fine. On export, I simply used: tf.saved_model.save(model, export_dir='models') And this works just fine.. until I reboot. On a reboot, the model no longer loads. I've tried using a Keras loader as well as the Tensorflow Server, and I get the same error. I get the following error message: Not found: /tmp/tfhub_modules/09bd4e665682e6f03bc72fbcff7a68bf879910e/assets/vocab.txt; No such

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

回眸只為那壹抹淺笑 提交于 2020-12-30 06:39:50
问题 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 = hub.text_embedding_column( key="sentence", module_spec="https://tfhub.dev/google/nnlm-en-dim128/1") The error i get is the following: RuntimeError Traceback (most recent call last) <ipython-input-18-df9239a27166> in <module>() 2 embedded_text_feature_column = hub

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

心不动则不痛 提交于 2020-12-30 06:37:14
问题 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 = hub.text_embedding_column( key="sentence", module_spec="https://tfhub.dev/google/nnlm-en-dim128/1") The error i get is the following: RuntimeError Traceback (most recent call last) <ipython-input-18-df9239a27166> in <module>() 2 embedded_text_feature_column = hub

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

不羁的心 提交于 2020-12-30 06:37:12
问题 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 = hub.text_embedding_column( key="sentence", module_spec="https://tfhub.dev/google/nnlm-en-dim128/1") The error i get is the following: RuntimeError Traceback (most recent call last) <ipython-input-18-df9239a27166> in <module>() 2 embedded_text_feature_column = hub

'no SavedModel bundles found!' on tensorflow_hub model deployment to AWS SageMaker

不问归期 提交于 2020-05-31 04:59:05
问题 I attempting to deploy the universal-sentence-encoder model to a aws Sagemaker endpoint and am getting the error raise ValueError('no SavedModel bundles found!') I have shown my code below, I have a feeling that one of my paths is incorrect import tensorflow as tf import tensorflow_hub as hub import numpy as np from sagemaker import get_execution_role from sagemaker.tensorflow.serving import Model def tfhub_to_savedmodel(model_name,uri): tfhub_uri = uri model_path = 'encoder_model/' + model