AttributeError: 'function' object has no attribute 'train_dialogue_model'

Issue : I get this error when i run python train_online.py WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 2019-05-28 18:37:01 WARNING tensorflow - From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. INFO:tensorflow:Restoring parameters from ./models/nlu/default/college_bot\component_5_EmbeddingIntentClassifier.ckpt 2019-05-28 18:37:01 INFO tensorflow - Restoring parameters from ./models/nlu/default/college_bot\component_5_EmbeddingIntentClassifier.ckpt Traceback (most recent call last): File “train_online.py”, line 32, in agent = train_agent(interpreter) File “train_online.py”, line 16, in train_agent return train.train_dialogue_model(domain_file=“college_bot_domain.yml”, AttributeError: ‘function’ object has no attribute ‘train_dialogue_model’

@tiwo19 Can you please use ``` around your error messages and code snippets to make it more readable? Thanks.

In order to help you I need more information. What do you want to achieve? And what Rasa version are you using? It would also help if you could past the code of train_online.py here. Thanks.

hi,

I am facing the below error as "AttributeError: ‘function’ object has no attribute 'train_dialogue_model’. I suspect the train_dialogue_model function is doesn’t exist. I couldn’t find the right function to fit in. I have share the below information on the issue. Kindly help me on this.

Version : 1.0.0rc2

Error:

C:\Users\HP\horoscope_bot>python train_online.py
2019-08-18 10:11:22.030464: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:\Users\HP\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
2019-08-18 10:11:22 WARNING  tensorflow  - From C:\Users\HP\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
INFO:tensorflow:Restoring parameters from ./models/nlu/default/horoscopebot\component_5_EmbeddingIntentClassifier.ckpt
2019-08-18 10:11:22 INFO     tensorflow  - Restoring parameters from ./models/nlu/default/horoscopebot\component_5_EmbeddingIntentClassifier.ckpt
Traceback (most recent call last):
  File "train_online.py", line 32, in <module>
    agent = train_agent(interpreter)
  File "train_online.py", line 16, in train_agent
    return train.train_dialogue_model(domain_file="horoscope_domain.yml",
AttributeError: 'function' object has no attribute 'train_dialogue_model'

Code:

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

import logging

from rasa_core import utils, train
from rasa_core.training import interactive
from rasa_core.interpreter import NaturalLanguageInterpreter

logger = logging.getLogger(__name__)


def train_agent(interpreter):
    return train.train_dialogue_model(domain_file="horoscope_domain.yml",
                                      stories_file="./data/stories.md",
                                      output_path="./models/dialogue",
                                      nlu_model_path=interpreter,
                                      endpoints="endpoints.yml",
                                      max_history=2,
                                      kwargs={"batch_size": 50,
                                              "epochs": 200,
                                              "max_training_samples": 300
                                              })


if __name__ == '__main__':
    utils.configure_colored_logging(loglevel="DEBUG")
    nlu_model_path = "./models/nlu/default/horoscopebot"
    interpreter = NaturalLanguageInterpreter.create(nlu_model_path)
    agent = train_agent(interpreter)
    interactive.serve_agent(agent)

Thanks. Rajasingam

It seems like you are mixing up the different Rasa versions. Please have a look at our example restaurantbot:

The example shows how to train models and how to create an agent.