Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Cannot concatenate sparse features as sequence dimension does not match #5171

Closed
tabergma opened this issue Feb 3, 2020 · 0 comments
Assignees
Labels
type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@tabergma
Copy link
Contributor

tabergma commented Feb 3, 2020

Rasa version: 1.7.0
Python version: 3.6

Issue:
Training with rasa train nlu using intent and responses does not work. Removing the responses from the training data, solves the issue.

https://forum.rasa.com/t/valueerror-sequence-dimensions-for-sparse-and-dense-features-dont-coincide/22844

Error (including full traceback):

Traceback (most recent call last):
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\saurabhd\AppData\Local\Programs\Python\Python36\Scripts\rasa.exe\__main__.py", line 7, in <module>
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\cli\train.py", line 76, in train
    kwargs=extract_additional_arguments(args),
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\train.py", line 46, in train
    kwargs=kwargs,
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\asyncio\base_events.py", line 484, in run_until_complete
    return future.result()
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\train.py", line 97, in train_async
    kwargs,
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\train.py", line 184, in _train_async_internal
    kwargs=kwargs,
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\train.py", line 241, in _do_training
    persist_nlu_training_data=persist_nlu_training_data,
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\train.py", line 470, in _train_nlu_with_validated_data
    persist_nlu_training_data=persist_nlu_training_data,
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\nlu\train.py", line 86, in train
    interpreter = trainer.train(training_data, **kwargs)
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\nlu\model.py", line 191, in train
    updates = component.train(working_data, self.config, **context)
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\nlu\featurizers\sparse_featurizer\regex_featurizer.py", line 67, in train
    self._text_features_with_regex(example, attribute)
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\nlu\featurizers\sparse_featurizer\regex_featurizer.py", line 76, in _text_features_with_regex
    message, extras, feature_name=SPARSE_FEATURE_NAMES[attribute]
  File "c:\users\saurabhd\appdata\local\programs\python\python36\lib\site-packages\rasa\nlu\featurizers\featurizer.py", line 67, in _combine_with_existing_sparse_features
    f"Cannot concatenate sparse features as sequence dimension does not "
ValueError: Cannot concatenate sparse features as sequence dimension does not match: 7 != 1. Make sure to set 'return_sequence' to the same value for all your featurizers.

Command or request that led to error:

rasa train nlu
@tabergma tabergma added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 3, 2020
@tabergma tabergma self-assigned this Feb 3, 2020
@tabergma tabergma closed this as completed Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

1 participant