'coroutine' object is not iterable

i have a problem with this TypeError: ‘coroutine’ object is not iterable Rasa version: 1.3.2 rasa-core:0.14.5 rasa-sdk:1.3.2 rasa-nlu:0.15.1 python version :3.6.6 this is my code train_dialog.py

def train_dialog(dialog_training_data_file,domain_file,path_to_model=‘models/dialogue’): ** logging.basicConfig(level =‘INFO’)**

** agent = Agent(domain_file,policies =[MemoizationPolicy(),KerasPolicy()])** ** training_data= agent.load_data(dialog_training_data_file)** ** agent.train(training_data)** ** agent.persist(path_to_model)**


train_dialog(‘data/stories.md’,‘domain.yml’) Help me. Thank you everyone.

Please try this below code it may will work.

async def train_core(domain_file: Text = “domain.yml”, model_directory: Text = “models”, model_name: Text = “core”, training_data_file: Text = “data/stories.md”,):

logging.basicConfig(filename=logfile, level=logging.DEBUG)

agent = Agent(
    domain_file,
    policies=[
        MemoizationPolicy(max_history=3),
        KerasPolicy(batch_size=100, epochs=400, validation_split=0.2)
    ]
)
training_data = await agent.load_data(training_data_file)
agent.train(training_data)

# Attention: agent.persist stores the model and all meta data into a folder.
# The folder itself is not zipped.
model_path = os.path.join(model_directory, model_name)
agent.persist(model_path)

if name == ‘ main ’: loop = asyncio.get_event_loop() loop.run_until_complete(train_core())