Closed jeisinge closed 2 years ago
https://tfhub.dev/google/universal-sentence-encoder/4 (/3) models are not supported under MirroredStrategy due the way the model(s) were published. The publisher of the model currently is not planning to republish the model, but rather recommends using
https://tfhub.dev/google/universal-sentence-encoder-cmlm/multilingual-base/1 https://tfhub.dev/google/universal-sentence-encoder-cmlm/multilingual-base-br/1
as illustrated in https://github.com/tensorflow/hub/issues/515#issuecomment-832059992
What happened?
The USE DAN model is an efficient embedder for short phrases. And, it trains well on a single GPU. However, it fails to train on a multi-GPU with
tf.distribute
.A couple of previous defects have been reported and closed out, but the issue remains. The closest one I found is #515 . The workaround proposed by RobRomijnders is to utilize
strategy.run()
, however, I don't understand how to do this with Keras. Specifically, calling this method returned aPerReplica
object --- I don't know how to merge it back to a regular Keras layer. See https://github.com/tensorflow/hub/issues/515#issuecomment-699928052 .https://tfhub.dev/google/universal-sentence-encoder/4 The TF model claims to be TF2, however, the SavedModel states that it is TF 1.15. If it was TF2, I believe it wouldn't have an issue with
tf.distribute
.https://colab.research.google.com/drive/1vgzBxzojLToHqR1XSGhmBepna1RfhXZG?usp=sharing Error colab notebook
Relevant code
Relevant log output
tensorflow_hub Version
0.12.0 (latest stable release)
TensorFlow Version
2.8 (latest stable release)
Other libraries
No response
Python Version
3.x
OS
Linux