tensorflow / hub

A library for transfer learning by reusing parts of TensorFlow models.
https://tensorflow.org/hub
Apache License 2.0
3.49k stars 1.67k forks source link

Bug: Seg fault for univerversal sentence encoder v3 with tf 2.14 #895

Closed youliangtan closed 1 year ago

youliangtan commented 1 year ago

What happened?

Receives segmentation fault when using tensorflow==2.14 for model: https://tfhub.dev/google/universal-sentence-encoder-multilingual/3

The same code works on tensorflow==2.13

Relevant code

import tensorflow_hub as hub
import tensorflow_text

MULTI_MODULE = "https://tfhub.dev/google/universal-sentence-encoder-multilingual/3"

muse_model = hub.load(MULTI_MODULE)
muse_model("hello world").numpy()

Relevant log output

>>> muse_model("hello world").numpy()
Segmentation fault (core dumped)

tensorflow_hub Version

other (please specify)

TensorFlow Version

2.8 (latest stable release)

Other libraries

Tensorflowhub: Version: 0.14.0 tensorflow: Version: 2.14.0

Python Version

3.x

OS

Linux

singhniraj08 commented 1 year ago

@youliangtan,

I am unable to replicate this issue in Colab environment and USE works fine with tensorflow 2.14.0. Ref: Gist

Please make sure to install and import tensorflow-text which is required by universal sentence encoder and let us know if you face any issues. Incase if this fails, try to create a new virtual environment with TF 2.14. Thank you!

youliangtan commented 1 year ago

Okay, my bad i tried it again and it works. I think with tensorflow==2.14 it didn't raise me a warning when tensorflow-text is not avail. I will close this issue. Thanks

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No