rasa_ch_faq icon indicating copy to clipboard operation
rasa_ch_faq copied to clipboard

运行rasa train时报错显示OSError

Open wenHK opened this issue 2 years ago • 1 comments

运行rasa train时报错,报错信息如下: Traceback (most recent call last): File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/transformers/modeling_tf_utils.py", line 1232, in from_pretrained missing_keys, unexpected_keys = load_tf_weights(model, resolved_archive_file) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/transformers/modeling_tf_utils.py", line 459, in load_tf_weights with h5py.File(resolved_archive_file, "r") as f: File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/h5py/_hl/files.py", line 406, in init fid = make_fid(name, mode, userblock_size, File "/Users/anaconda3/envs/rasa/lib/python3.8/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 "/Users/anaconda3/envs/rasa/bin/rasa", line 8, in sys.exit(main()) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/main.py", line 117, in main cmdline_arguments.func(cmdline_arguments) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/cli/train.py", line 59, in train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True)) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/cli/train.py", line 91, in run_training training_result = train_all( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/api.py", line 109, in train return rasa.utils.common.run_in_loop( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/utils/common.py", line 296, in run_in_loop result = loop.run_until_complete(f) File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/model_training.py", line 108, in train_async return await _train_async_internal( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/model_training.py", line 289, in _train_async_internal await _do_training( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/model_training.py", line 335, in _do_training model_path = await _train_nlu_with_validated_data( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/model_training.py", line 759, in _train_nlu_with_validated_data await rasa.nlu.train.train( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/train.py", line 97, in train trainer = Trainer( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/model.py", line 167, in init self.pipeline = self._build_pipeline(cfg, component_builder) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/model.py", line 178, in _build_pipeline component = component_builder.create_component(component_cfg, cfg) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/components.py", line 938, in create_component component = registry.create_component_by_config(component_config, cfg) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/registry.py", line 193, in create_component_by_config return component_class.create(component_config, config) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py", line 105, in create return cls(component_config, hf_transformers_loaded=hf_transformers_loaded) File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py", line 88, in init self._load_model_instance(skip_model_load) File "/Users/wenhk/Downloads/rasa_ch_faq/compoments/nlu/featurizer/lm_featurizer.py", line 83, in _load_model_instance self.model = model_class_dict[self.model_name].from_pretrained( File "/Users/anaconda3/envs/rasa/lib/python3.8/site-packages/transformers/modeling_tf_utils.py", line 1234, in from_pretrained raise OSError( 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.

请问这是什么问题?

wenHK avatar Feb 07 '23 02:02 wenHK