Policy_name = type(policies[0]).__name__ IndexError: list index out of range

python -m rasa_core.train compare --s tories data/core/ -d domain.yml -o comparison_mode ls -c redp.yml lstm_bin.yml lstm_feat.yml --augmen tation 0 --runs 5

2019-01-16 12:36:24 INFO root - Starting run 1/5 Traceback (most recent call last): File “C:\Users\vigne\Anaconda3\lib\runpy.py”, line 193, in _run_module_as_main “main”, mod_spec) File “C:\Users\vigne\Anaconda3\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Users\vigne\Anaconda3\lib\site-packages\rasa_core\train.py”, line 368, in additional_args) File “C:\Users\vigne\Anaconda3\lib\site-packages\rasa_core\train.py”, line 284, in do_compare_training additional_arguments) File “C:\Users\vigne\Anaconda3\lib\site-packages\rasa_core\train.py”, line 239, in train_comparison_models policy_name = type(policies[0]).name IndexError: list index out of range

can anyone help me out

and also checked the source code it getting the policies name to save the model in policies name

if len(policies) > 1: raise ValueError("You can only specify one policy per " “model for comparison”)

            policy_name = type(policies[0]).__name__
            output = os.path.join(output_path, 'run_' + str(r + 1),
                                  policy_name +
                                  str(current_round))

            logging.info("Starting to train {} round {}/{}"
                         " with {}% exclusion"
                         "".format(policy_name, current_round,
                                   len(exclusion_percentages), i))

            train_dialogue_model(
                domain, stories, output,
                policy_config=policy_config,
                exclusion_percentage=i,
                kwargs=kwargs,
                dump_stories=dump_stories)

this is solved https://github.com/RasaHQ/rasa_core/issues/1579

This error basically means you are trying to access a value at a List index which is out of bounds i.e greater than the last index of the list or less than the least index in the list. So the first element is 0, second is 1, so on. So if there are n elements in a python list, the last element is n-1 . If you try to access the empty or None element by pointing available index of the list, then you will get the "List index out of range " error. To solve this error, you should make sure that you’re not trying to access a non-existent item in a list.