I get the following error when I run rasa train nlu:
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/utils/spacy_utils.py”, line 97, in cache_key
return cls.name + “-” + spacy_model_name
TypeError: can only concatenate str (not “NoneType”) to str
Training NLU model…
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.8/bin/rasa”, line 8, in
sys.exit(main())
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/main.py”, line 118, in main
cmdline_arguments.func(cmdline_arguments)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/cli/train.py”, line 196, in run_nlu_training
return train_nlu(
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/model_training.py”, line 646, in train_nlu
return rasa.utils.common.run_in_loop(
File “/Library/Frameworks/Python.framework/Versions/3.8/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 “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/model_training.py”, line 696, in train_nlu_async
return await _train_nlu_with_validated_data(
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/model_training.py”, line 758, in _train_nlu_with_validated_data
await rasa.nlu.train.train(
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/train.py”, line 96, in train
trainer = Trainer(
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/model.py”, line 169, in init
self.pipeline = self._build_pipeline(cfg, component_builder)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/model.py”, line 180, in _build_pipeline
component = component_builder.create_component(component_cfg, cfg)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/components.py”, line 936, in create_component
component, cache_key = self.__get_cached_component(
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/components.py”, line 853, in __get_cached_component
cache_key = component_class.cache_key(component_meta, model_metadata)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rasa/nlu/utils/spacy_utils.py”, line 97, in cache_key
return cls.name + “-” + spacy_model_name
TypeError: can only concatenate str (not “NoneType”) to str
@AzizDiallo Hello, I can see there is no model in your pipeline for Spacy? Ref: Components please even check the other components also such as SpacyTokenizer and SpacyFeaturizer Ref: Components
@AzizDiallo I hope you install the dependencies spacy in the environment?
@nik202 Thank you for replying. Before running rasa train nlu, I followed what is mentioned at Installing Rasa Spacy error - #2 by Arjaan and ran pip install -U “rasa[spacy]” then pip3 install -U “rasa[spacy]” and python3 -m space download en_core_web_md.
I am using a MacBook. the command you mentioned didn’t work for me.
It only works when I use default pipeline setting (empty).
Thanks, this solved the problem. There is some documentation inconsistency I guess. I was referring to this and no model parameter was added there for some reason.