RuntimeError: variable_scope bert_layer_module/ was unused but the corresponding name_scope was already taken

i got

  File "..../site-packages/tensorflow_hub/module.py", line 403, in _try_get_state_scope
    "name_scope was already taken." % abs_state_scope)
RuntimeError: variable_scope bert_layer_module/ was unused but the corresponding name_scope was already taken.

when tried to use BertLayer class included with

self.bert = hub.Module(
TensorFlow Hub”,
trainable=self.trainable,
name="{}_module".format(self.name)
)

is there any help please

What is your TF version?

Verified - Khushboo Gupta

if you are trying to use TFHub + BERT, I’d suggest you follow this:

hub.Module is for the old version, it’s better to use hub.load or hub.KerasLayer now