rasa: ERROR:rasa_core.training.interactive:An exception occurred while recording messages.

Rasa Core version: rasa-nlu ==0.14.1 rasa-coe == 0.13.0 rasa-core-sdk==0.12.1 Python version: 3.6.8(64bit)

Operating system (windows, osx, …):windows

Issue: I try to train the model online but everytime i get the following error

Chat History

 #    Bot                                                                       You
───────────────────────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────────────────────
 2                                                                                     hey
                                                                        intent: greet 0.72
───────────────────────────────────────────────────────────────────────────────────────────
 3    utter_greet 1.00
      Hello! How can I help?
      utter_ask_category
      can you choose the category you are interested in?
      Buttons:
      1: Tag
      (/inform{"category":"Tag"})
      2: Market (inform{"category":"Market"})
      action_listen
───────────────────────────────────────────────────────────────────────────────────────────
 4                                                            /inform{"category":"Market"}
                                                                       intent: inform 1.00
───────────────────────────────────────────────────────────────────────────────────────────
 5    slot{"category": "Market"}


Current slots:
        category: Market, name: None

------
? What is the next action of the bot?  0.08 action_listen
Thanks! The bot will now run action_listen.

ERROR:rasa_core.training.interactive:An exception occurred while recording messages.
Traceback (most recent call last):
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\interactive.py", line 1216, in record_messages
    finetune, sender_ids, plot_file)
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\interactive.py", line 824, in _predict_till_next_listen
    _plot_trackers(sender_ids, plot_file, endpoint)
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\interactive.py", line 1151, in _plot_trackers
    max_history=2)
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\visualization.py", line 448, in visualize_neighborhood
    _merge_equivalent_nodes(graph, max_history)
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\visualization.py", line 200, in _merge_equivalent_nodes
    _nodes_are_equivalent(graph, i, j, max_history)):
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\visualization.py", line 145, in _nodes_are_equivalent
    _fingerprint_node(graph, node_b, max_history)))
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\visualization.py", line 111, in _fingerprint_node
    for continuation in continuations}
  File "C:\Users\swarnalathaa\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_core\training\visualization.py", line 111, in <setcomp>
    for continuation in continuations}
TypeError: sequence item 1: expected str instance, dict found

Content of domain file (if used & relevant):

slots:
  category:
    type: text
  name:
    type: text

intents:
 - greet
 - goodbye
 - inform


entities:
  - category
  - name

templates: 
  utter_ask_category: 
    - 
      buttons: 
        - 
          payload: "/inform{\"category\":\"Tag\"}"
          title: Tag
        - 
          payload: "inform{\"category\":\"Market\"}"
          title: Market
      text: "can you choose the category you are interested in?"

  utter_dont_understand: 
    - "Sorry, I dont understand what you are asking for :("
  utter_goodbye: 
    - "Talk to you later."
    - "Bye bye :("
  utter_greet: 
    - "Hello! How can I help?"



actions:
 - utter_greet
 - utter_goodbye
 - utter_ask_category
 - utter_dont_understand
 - action_news

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

@Nexemics you are doing it wrongly.If you are using script then while calling run_interactive_learning pass skip_visualization=True like this : interactive.run_interactive_learning(agent,training_data_file,skip_visualization=True)

or through terminal you can do like this:

python -m rasa_core.train interactive -o models/dialogue -d domain.yml -c policy_config.yml -s data/stories.md --skip_visualization --nlu models/current/nlu --endpoints endpoints.yml

Hi @shanushawan ,

  1. If you are getting error something like the one mentioned above during interactive training then try to run your interactive training by disabling visualization. check this link https://rasa.com/docs/core/interactive_learning/

  2. Since I wanted to reset all slots after the action_news has been performed, I made a separate action in actions.py which will reset all the slots.

class Actionreset(Action):

def name(self):
    return 'action_reset'

def run(self, dispatcher, tracker, domain):
    return [AllSlotsReset()]

and in my stories I need to call this action after action_news to reset all slots. Hope this helps 😃

Ahh OK, it is my understanding that is a bug with our visualisation script that arises when setting the same slot twice in one turn. We can work a fix for this, however in the meantime I would recommend trying:

  • Running the script with the flag --skip_visualization
  • Creating a separate action ‘reset_slots’ which is predicted in your story data after -action_news. For this you just need the action to return the AllSlotsReset() event from rasa_core_sdk.events

Thanks for bringing this to our attention!