You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have downloaded BERT Muril from link
bert_url = "https://tfhub.dev/google/MuRIL-Large/1"
self.bert_tokenizer = self.load_bert_vocab()
def load_bert_vocab(self):
with tf.Graph().as_default():
bert_model = hub.Module(self.bert_url)
vocab_info = bert_model(signature="tokenization_info",as_dict=True)
with tf.Session() as sess:
vocab_file, do_lower_case = sess.run([vocab_info["vocab_file"],vocab_info["do_lower_case"]])
RuntimeError: Missing implementation that supports: loader(*('/tmp/tfhub_modules/4f3530e4487d53ac1743187947c06ce11dbda528',), **{})
File "train.py", line 19, in
model = util.get_model(config)
File "/home/dr/Desktop/master/util.py", line 27, in get_model
model = bert_md.BertMD(config)
File "/home/dr/Desktop/r/nn_md.py", line 18, in init
input_props = self.add_model_specific_valuables(config)
File "/home/dr/Desktop/r/bert_md.py", line 20, in add_model_specific_valuables
self.bert_tokenizer = self.load_bert_vocab()
File "/home/dr/Desktop/r/bert_md.py", line 45, in load_bert_vocab
bert_model = hub.Module(self.bert_url)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 154, in init
self._spec = as_module_spec(spec)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 36, in as_module_spec
return load_module_spec(spec)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 64, in load_module_spec
return registry.loader(path)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/registry.py", line 45, in call
self._name, args, kwargs))
RuntimeError: Missing implementation that supports: loader(*('/tmp/tfhub_modules/4f3530e4487d53ac17431879
The text was updated successfully, but these errors were encountered:
You're trying to load the model via hub.Module. This doesn't work since the model hasn't been stored as a TF1 Module. In the documentation, you can see that it has to be loaded using hub.KerasLayer (or hub.load).
When loading it as a KerasLayer layer = hub.KerasLayer("https://tfhub.dev/google/MuRIL-Large/1")
you can access the path to the vocab via layer.resolved_object.vocab_file.asset_path
i have downloaded BERT Muril from link
bert_url = "https://tfhub.dev/google/MuRIL-Large/1"
self.bert_tokenizer = self.load_bert_vocab()
def load_bert_vocab(self):
with tf.Graph().as_default():
bert_model = hub.Module(self.bert_url)
vocab_info = bert_model(signature="tokenization_info",as_dict=True)
with tf.Session() as sess:
vocab_file, do_lower_case = sess.run([vocab_info["vocab_file"],vocab_info["do_lower_case"]])
and got error
RuntimeError: Missing implementation that supports: loader(*('/tmp/tfhub_modules/4f3530e4487d53ac1743187947c06ce11dbda528',), **{})
File "train.py", line 19, in
model = util.get_model(config)
File "/home/dr/Desktop/master/util.py", line 27, in get_model
model = bert_md.BertMD(config)
File "/home/dr/Desktop/r/nn_md.py", line 18, in init
input_props = self.add_model_specific_valuables(config)
File "/home/dr/Desktop/r/bert_md.py", line 20, in add_model_specific_valuables
self.bert_tokenizer = self.load_bert_vocab()
File "/home/dr/Desktop/r/bert_md.py", line 45, in load_bert_vocab
bert_model = hub.Module(self.bert_url)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 154, in init
self._spec = as_module_spec(spec)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 36, in as_module_spec
return load_module_spec(spec)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/module.py", line 64, in load_module_spec
return registry.loader(path)
File "/home/dr/anaconda3/envs/hp/lib/python2.7/site-packages/tensorflow_hub/registry.py", line 45, in call
self._name, args, kwargs))
RuntimeError: Missing implementation that supports: loader(*('/tmp/tfhub_modules/4f3530e4487d53ac17431879
The text was updated successfully, but these errors were encountered: