RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.9k stars 4.63k forks source link

Interactive Training: Can not access action 'None' #2743

Closed tahamr83 closed 5 years ago

tahamr83 commented 5 years ago
**Rasa Core version**: 0.12.0 **Python version**: 3.6.6 **Operating system** (windows, osx, ...): MacOs Mojave **Issue**: When training interactively the action does not execute. ------ ``` The bot wants to run 'action_set_preferences', correct? Yes 2018-11-14 18:46:07 ERROR rasa_core.server - Can not access action 'None', as that name is not a registered action for this domain. Available actions are: - action_listen - action_restart - action_default_fallback - action_set_preferences Traceback (most recent call last): File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/server.py", line 220, in execute_action confidence) File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/agent.py", line 359, in execute_action confidence) File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/processor.py", line 150, in execute_action action = self._get_action(action_name) File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/processor.py", line 239, in _get_action return self.domain.action_for_name(action_name, self.action_endpoint) File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/domain.py", line 284, in action_for_name self._raise_action_not_found_exception(action_name) File "/Users/muhammadtahazaidi/MyFiles/WorkVocinity/venvs/env_vocinity-mcdonalds/lib/python3.6/site-packages/rasa_core/domain.py", line 323, in _raise_action_not_found_exception "".format(action_name, action_names)) NameError: Can not access action 'None', as that name is not a registered action for this domain. Available actions are: - action_listen - action_restart - action_default_fallback - action_set_preferences ``` I have peeked at the rasa_core code. The `payload = ActionExecuted(action_name, policy, confidence).as_dict()`(interactive.py) has the actions name as 'name' key while server.py expects the name of the action as `request_params.get("action", None)` (server.py line 209). For the purposes of interactive learning it works by changing it to `request_params.get("name", None)`
tzolkincz commented 5 years ago

Hi @tahamr83, this is possibly duplicate of #1320, which has been fixed 2 days ago.

tahamr83 commented 5 years ago

@tzolkincz so pypi must be distrubting the unfixed version. I just pip installed rasa_core 0.12.0 today. Any idea how to install the fixed version ?. I must be missing something here.

tzolkincz commented 5 years ago

@tahamr83 Well, You can install rasa_core directly from the git repo, but official release with the fix was not created yet, so You'd end up with a master branch or some particular commit. Or You can wait till next release (or of course, for development purpose only, You can locally fix that one file).

tahamr83 commented 5 years ago

I will be closing the issue now. Thanks for your input @tzolkincz

sandeepkumarsahoo commented 5 years ago

I am getting similar kind of issue . ActionTest.py

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from rasa_core.actions.action import Action
class ActionTest(Action):
    def name(self):
        return 'action_get_weather'

    def run(self, dispatcher, tracker, domain):

        dispatcher.utter_message('We did not find any weather information for Search by a city name.')
        return

domain.yml

..
actions:
# templates (as they are reply actions),
# also custom actions if any
 - utter_greet
 - utter_answer_31_days
 - utter_answer_30_days
 - utter_answer_28_days
 - utter_bye
 - actions.ActionTest

stories.md

## story6
* greet
  - action_test

During training am getting the below error -

  domains action list. If you recently removed an action, don't worry about this warning. It should stop appearing after a while. 
2018-12-22 20:35:09 WARNING  rasa_core.domain  - Failed to use action 'action_test' in history. Please make sure all actions are listed in the domains action list. If you recently removed an action, don't worry about this warning. It should stop appearing after a while. 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/rasa_core/domain.py", line 314, in index_for_action
    return self.action_names.index(action_name)
ValueError: 'action_test' is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/train.py", line 358, in <module>
    additional_args)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/train.py", line 273, in do_default_training
    kwargs=additional_arguments)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/train.py", line 197, in train_dialogue_model
    agent.train(training_data, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/agent.py", line 536, in train
    **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/policies/ensemble.py", line 67, in train
    policy.train(training_trackers, domain, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/policies/keras_policy.py", line 154, in train
    **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/policies/policy.py", line 74, in featurize_for_training
    domain)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/featurizers.py", line 406, in featurize_trackers
    y = self._featurize_labels(trackers_as_actions, domain)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/featurizers.py", line 373, in _featurize_labels
    for action in tracker_actions]
  File "/usr/local/lib/python3.6/site-packages/rasa_core/featurizers.py", line 373, in <listcomp>
    for action in tracker_actions]
  File "/usr/local/lib/python3.6/site-packages/rasa_core/featurizers.py", line 62, in action_as_one_hot
    y[domain.index_for_action(action)] = 1
  File "/usr/local/lib/python3.6/site-packages/rasa_core/domain.py", line 316, in index_for_action
    self._raise_action_not_found_exception(action_name)
  File "/usr/local/lib/python3.6/site-packages/rasa_core/domain.py", line 325, in _raise_action_not_found_exception
    "".format(action_name, action_names))
NameError: Cannot access action 'action_test', as that name is not a registered action for this domain. Available actions are: 
     - action_listen
     - action_restart
     - action_default_fallback
     - action_deactivate_form
     - utter_greet
     - utter_answer_31_days
     - utter_answer_30_days
     - utter_answer_28_days
     - utter_bye
     - actions.ActionTest

Can someone help me ? Thanks in advance

rohangore1999 commented 5 years ago

@tmbo add '- action_test' in domain.yml in action section that may be work