Hi Team,
I am trying to use BERT model in the pipeline in RASA version 1.10.1.
After executing rasa train command getting below error;
(rasa_new) [dnachatbot@bbsr02cloud05 rasa_init]$ rasa train
2020-06-17 13:37:59 INFO rasa.model - Data (nlu-config) for NLU model section changed.
Core stories/configuration did not change. No need to retrain Core model.
Training NLU model…
2020-06-17 13:38:00 INFO transformers.file_utils - PyTorch version 1.5.0 available.
2020-06-17 13:38:00 INFO transformers.file_utils - TensorFlow version 2.1.0 available.
2020-06-17 13:38:00 INFO transformers.tokenization_utils - Model name ‘/dnachatbot/rahul/rasa_init/bert_config.json’ not found in model shortcut name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc, bert-base-german-dbmdz-cased, bert-base-german-dbmdz-uncased, TurkuNLP/bert-base-finnish-cased-v1, TurkuNLP/bert-base-finnish-uncased-v1, wietsedv/bert-base-dutch-cased). Assuming ‘/dnachatbot/rahul/rasa_init/bert_config.json’ is a path, a model identifier, or url to a directory containing tokenizer files.
2020-06-17 13:38:00 WARNING transformers.tokenization_utils - Calling BertTokenizer.from_pretrained() with the path to a single file or url is deprecated
2020-06-17 13:38:00 INFO transformers.tokenization_utils - loading file /dnachatbot/rahul/rasa_init/bert_config.json
2020-06-17 13:38:00 INFO transformers.configuration_utils - loading configuration file /dnachatbot/rahul/rasa_init/bert_config.json
2020-06-17 13:38:00 INFO transformers.configuration_utils - Model config BertConfig {
“attention_probs_dropout_prob”: 0.1,
“hidden_act”: “gelu”,
“hidden_dropout_prob”: 0.1,
“hidden_size”: 768,
“initializer_range”: 0.02,
“intermediate_size”: 3072,
“layer_norm_eps”: 1e-12,
“max_position_embeddings”: 512,
“model_type”: “bert”,
“num_attention_heads”: 12,
“num_hidden_layers”: 12,
“pad_token_id”: 0,
“type_vocab_size”: 2,
“vocab_size”: 30522
}
2020-06-17 13:38:00 INFO transformers.modeling_tf_utils - loading weights file /dnachatbot/rahul/rasa_init/bert_config.json
2020-06-17 13:38:00.497039: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
Traceback (most recent call last):
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/transformers/modeling_tf_utils.py”, line 401, in from_pretrained
model.load_weights(resolved_archive_file, by_name=True)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py”, line 234, in load_weights
return super(Model, self).load_weights(filepath, by_name, skip_mismatch)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py”, line 1215, in load_weights
with h5py.File(filepath, ‘r’) as f:
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/h5py/_hl/files.py”, line 408, in init
swmr=swmr)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/h5py/_hl/files.py”, line 173, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File “h5py/_objects.pyx”, line 54, in h5py._objects.with_phil.wrapper
File “h5py/_objects.pyx”, line 55, in h5py._objects.with_phil.wrapper
File “h5py/h5f.pyx”, line 88, in h5py.h5f.open
OSError: Unable to open file (file signature not found)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/dnachatbot/murali/rasa_new/bin/rasa”, line 8, in
sys.exit(main())
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/main.py”, line 91, in main
cmdline_arguments.func(cmdline_arguments)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/cli/train.py”, line 76, in train
additional_arguments=extract_additional_arguments(args),
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/train.py”, line 50, in train
additional_arguments=additional_arguments,
File “uvloop/loop.pyx”, line 1451, in uvloop.loop.Loop.run_until_complete
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/train.py”, line 101, in train_async
additional_arguments,
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/train.py”, line 188, in _train_async_internal
additional_arguments=additional_arguments,
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/train.py”, line 245, in _do_training
persist_nlu_training_data=persist_nlu_training_data,
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/train.py”, line 482, in _train_nlu_with_validated_data
persist_nlu_training_data=persist_nlu_training_data,
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/train.py”, line 75, in train
trainer = Trainer(nlu_config, component_builder)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/model.py”, line 145, in init
self.pipeline = self._build_pipeline(cfg, component_builder)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/model.py”, line 157, in _build_pipeline
component = component_builder.create_component(component_cfg, cfg)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/components.py”, line 769, in create_component
component = registry.create_component_by_config(component_config, cfg)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/registry.py”, line 246, in create_component_by_config
return component_class.create(component_config, config)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/components.py”, line 483, in create
return cls(component_config)
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/utils/hugging_face/hf_transformers.py”, line 47, in init
self._load_model()
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/rasa/nlu/utils/hugging_face/hf_transformers.py”, line 84, in _load_model
self.model_weights, cache_dir=self.cache_dir
File “/dnachatbot/murali/rasa_new/lib/python3.6/site-packages/transformers/modeling_tf_utils.py”, line 404, in from_pretrained
"Unable to load weights from h5 file. "
OSError: Unable to load weights from h5 file. If you tried to load a TF 2.0 model from a PyTorch checkpoint, please set from_pt=True.
Can you please help