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

Option share_hidden_layers does not work as expected #6053

Closed
tabergma opened this issue Jun 23, 2020 · 0 comments · Fixed by #6054
Closed

Option share_hidden_layers does not work as expected #6053

tabergma opened this issue Jun 23, 2020 · 0 comments · Fixed by #6054
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@tabergma
Copy link
Contributor

tabergma commented Jun 23, 2020

Rasa version: current master
Python version: 3.7

Issue:
If the option share_hidden_layers is enabled in the DIETClassifier, we have a check which verifies that the feature dimension of the text and label features is the same. However, we also have an additional check that causes issues: That check compares the data_signature of the text and label features. data_signature stores the type of the feature and the shape of the first example. For example, it could be that the shape of text_features is 2x53 and the shape of label_features is 1x53. In this case the check fails, but it should not.

Error (including full traceback):

Traceback (most recent call last):
  File "/Users/tabergma/Repositories/rasa/rasa/__main__.py", line 119, in <module>
    main()
  File "/Users/tabergma/Repositories/rasa/rasa/__main__.py", line 108, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/Users/tabergma/Repositories/rasa/rasa/cli/train.py", line 142, in train_nlu
    additional_arguments=extract_nlu_additional_arguments(args),
  File "/Users/tabergma/Repositories/rasa/rasa/train.py", line 431, in train_nlu
    additional_arguments,
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/Users/tabergma/Repositories/rasa/rasa/train.py", line 472, in _train_nlu_async
    additional_arguments=additional_arguments,
  File "/Users/tabergma/Repositories/rasa/rasa/train.py", line 506, in _train_nlu_with_validated_data
    **additional_arguments,
  File "/Users/tabergma/Repositories/rasa/rasa/nlu/train.py", line 90, in train
    interpreter = trainer.train(training_data, **kwargs)
  File "/Users/tabergma/Repositories/rasa/rasa/nlu/model.py", line 191, in train
    updates = component.train(working_data, self.config, **context)
  File "/Users/tabergma/Repositories/rasa/rasa/nlu/classifiers/diet_classifier.py", line 716, in train
    config=self.component_config,
  File "/Users/tabergma/Repositories/rasa/rasa/nlu/classifiers/diet_classifier.py", line 1032, in __init__
    self._check_data()
  File "/Users/tabergma/Repositories/rasa/rasa/nlu/classifiers/diet_classifier.py", line 1099, in _check_data
    "If hidden layer weights are shared, data signatures "
ValueError: If hidden layer weights are shared, data signatures for text_features and label_features must coincide.

Command or request that led to error:

rasa train

Content of configuration file (config.yml) (if relevant):

language: en
pipeline:
  - name: WhitespaceTokenizer
  - name: CountVectorsFeaturizer
    use_shared_vocab: True
  - name: DIETClassifier
    epochs: 100
    share_hidden_layers: True
@tabergma tabergma added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Jun 23, 2020
@tabergma tabergma self-assigned this Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant