Closed brenting closed 4 years ago
Could reproduce the issue in Google Colab. Kernel Crashes with the above code. Here is the Github_Gist_Of_Colab
The crash does not occur with the new USE-multilingual model: https://tfhub.dev/google/universal-sentence-encoder-multilingual/2
Thanks, @brenting , for the update! I guess that is the preferred solution then:
sentencepiece==0.1.84
and tf-sentencepiece==0.1.84
(for now with the manual download you describe).tf-sentencepiece>=0.1.83
and sentencepiece>=0.1.83
.It's a bit unfortunate that all these versions need to be aligned, and that there are no useful error messages, but that isn't something we can fix in the TF Hub code.
Adding vbardiovskyg; please close if you see nothing else.
According to the documentation accompanying the new USE-multilingual-2 model, the model lost its dependency on sentencepiece
and tf-sentencepiece
and now requires tensorflow_text>=2.0.0rc0
.
For the older versions of TF, due to the bug in https://github.com/google/sentencepiece/pull/417, it is likely that only the exact TF versions found on the tf-sentencepiece v0.1.83 page work for USE-multilingual-1. This will be the case until the fix is implemented in older packages of (tf-)sentencepiece.
Long story short. For now:
tensorflow_text>=2.0.0rc0
and tensorflow-hub
as described in the documentation.sentencepiece==0.1.83
and tf-sentencepiece==0.1.83
pick one of TF versions found on the tf-sentencepiece v0.1.83 page and install that exact TF version. Then load the model via tensorflow-hub
.Also change ["output"]
to ["outputs"]
in the example on the USE-multilingual-2 page.
PS:
Although tf-sentencepiece==0.1.84
is available, tf-sentencepiece==0.1.83
is still the default version in pip
. USE-multilingual-1 with tf-sentencepiece v0.1.84 potentially only works for TF1.13.1, TF1.14.0 and TF2.0.0 until the previously described fix is implemented (or fixed by hand).
PPS: Save yourself some trouble and go for USE-multilingual-2 with TF2.0 :).
https://tfhub.dev/google/universal-sentence-encoder-multilingual/3 now supports TF2.0 and uses tensorflow_text instead of tf_sentencepiece.
Nice.
With that, can we close this issue?
The crash does not occur with the new USE-multilingual model: https://tfhub.dev/google/universal-sentence-encoder-multilingual/2
The issue was already solved when USE-multilingual-2 came out, which supports TF2.0 and uses tensorflow_text
. If you do not intend to add TF2.0 support to USE-multilingual-1 in retrospect, then this issue can indeed be closed.
Thanks for confirming.
Module version 1 won't be changed, because TF Hub module contents are immutable (to avoid consistency issues with caching etc.).
I am getting a segmentation fault like in #345.
It happens when I do:
The output is as follows:
I have to use (tf-)sentencepiece 0.1.84 due to a bug in 0.1.83 addressed in https://github.com/google/sentencepiece/pull/417. (tf-)sentencepiece 0.1.84 is not available yet in pip, but this problem can still be reproduced in Google Colab via a workaround. The following code will make the Google Colab kernel crash: