Tensorflow Error on Rasa X 0.35

Hi !

I updated Rasa X from 0.34 to 0.35 using Docker Compose Install Script.

I got the following errors when adding messages to conversations

2021-01-20 14:04:15 ERROR rasa.core.channels.rest - An exception occured while handling user message ‘Bonjour Oui cela concerne Annecy’. Traceback (most recent call last): File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/eager/function.py”, line 2688, in _convert_inputs_to_signature check_types=False) # lists are convert to tuples for tf.data. File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/util/nest.py”, line 952, in flatten_up_to expand_composites=expand_composites) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/util/nest.py”, line 870, in assert_shallow_structure expand_composites=expand_composites) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/util/nest.py”, line 854, in assert_shallow_structure input_length=len(input_tree), shallow_length=len(shallow_tree))) ValueError: The two structures don’t have the same sequence length. Input structure has length 8, while shallow structure has length 10. During handling of the above exception, another exception occurred: Traceback (most recent call last): File “/opt/venv/lib/python3.7/site-packages/rasa/core/channels/rest.py”, line 126, in receive metadata=metadata, File “/opt/venv/lib/python3.7/site-packages/rasa/core/channels/channel.py”, line 85, in handler await app.agent.handle_message(*args, **kwargs) File “/opt/venv/lib/python3.7/site-packages/rasa/core/agent.py”, line 528, in handle_message return await processor.handle_message(message) File “/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py”, line 87, in handle_message tracker = await self.log_message(message, should_save_tracker=False) File “/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py”, line 304, in log_message await self._handle_message_with_tracker(message, tracker) File “/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py”, line 566, in _handle_message_with_tracker parse_data = await self.parse_message(message, tracker) File “/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py”, line 545, in parse_message text, message.message_id, tracker, metadata=message.metadata File “/opt/venv/lib/python3.7/site-packages/rasa/core/interpreter.py”, line 145, in parse result = self.interpreter.parse(text) File “/opt/venv/lib/python3.7/site-packages/rasa/nlu/model.py”, line 454, in parse component.process(message, **self.context) File “/opt/venv/lib/python3.7/site-packages/rasa/nlu/classifiers/diet_classifier.py”, line 918, in process out = self._predict(message) File “/opt/venv/lib/python3.7/site-packages/rasa/nlu/classifiers/diet_classifier.py”, line 834, in _predict return self.model.predict(model_data) File “/opt/venv/lib/python3.7/site-packages/rasa/utils/tensorflow/models.py”, line 341, in predict return self._predict_function(batch_in) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py”, line 780, in call result = self._call(*args, **kwds) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py”, line 814, in _call results = self._stateful_fn(*args, **kwds) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/eager/function.py”, line 2828, in call graph_function, args, kwargs = self._maybe_define_function(args, kwargs) File “/opt/venv/lib/python3.7/site-packages/tensorflow/python/eager/function.py”, line 3171, in _maybe_define_function

Hi @guillaumecostanza! Which version of rasa open source have you used for training your model? Maybe you need to retrain the model.

Hope this helps!!

Hi @kalkbrennerei.

Unfortunately re-training didn’t changed anything. Rasa Version is 2.2.5

I removed SpacyNLP + SpacyTokenizer + SpacyFeaturizer from the pipeline for now :

pipeline:
- name: WhitespaceTokenizer
  intent_tokenization_flag: True
  intent_split_symbol: "+"
  token_pattern: None
# - name: SpacyNLP
# - name: SpacyTokenizer
#   intent_tokenization_flag: True
#   intent_split_symbol: "+"
# - name: SpacyFeaturizer
- name: RegexFeaturizer
  case_sensitive: False
  use_lookup_tables: True
  use_regexes: True
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
  analyzer: "char_wb"
  min_ngram: 1
  max_ngram: 4

- name: CRFEntityExtractor
  BILOU_flag: True

- name: DIETClassifier
  epochs: 300
  entity_recognition: False

- name: EntitySynonymMapper

policies:
- name: TEDPolicy
  epochs: 100

For information, we run the following commands directly into the rasa-production container to add spacy additionnal ressources :

python3 -m spacy download fr_core_news_md
python3 -m spacy link fr_core_news_md fr

are you using the same spacy versions during training as in production container?

not sure but I think you need to specify the language in your config so that spacy would use non English embeddings

Yes it is present in the pipeline !

The training is done in our CI and then uploaded to Rasa X. I’ve attached our pipenv lock file

Pipfile.lock (102.2 KB)