Open zhijun510 opened 1 year ago
Probably can you try to put the embeds into model_creator and have another try? Something like:
def model_creator(config):
// Put embed here instead of in get_model
embed1 = hub.KerasLayer(SparkFiles.get(finddistancename), trainable = True)
embed2 = hub.KerasLayer(SparkFiles.get(finddistancename), trainable = True)
Thanks for your reply. I tried your solution but now I encountered another error:
_tensorflow.python.framework.errorsimpl.InvalidArgumentError: Graph execution error:
Node: 'Assert/Assert' _assertion failed: [Trying to access a placeholder that is not supposed to be executed. This means you are executing a graph _generated from the cross-replica context in an in-replica context.]_ [[{{node Assert/Assert}}]] [Op:__inference_restored_function_body3839]
Is it caused by the keras layer downloaded from tensorflow hub?
Sorry for the late reply. We haven't tested for layers using tf hub and we will reproduce it very soon. @sgwhat Please take a look at it.
We have reproduced your issue, and the reason is that this model does not support usage under strategy.scope()
. According to the official response from TensorFlow Hub team, you may switch to the following models instead:
https://tfhub.dev/google/universal-sentence-encoder-cmlm/multilingual-base/1 https://tfhub.dev/google/universal-sentence-encoder-cmlm/multilingual-base-br/1
For more details, you may see the TF Hub Reply.
Hello,
I try to train a DL model with tensorhub keras layer (trainable = True), but I got the following error:
_pickle.PickleError: can't pickle repeated message fields, convert to list first
`