# AttributeError: 'function' object has no attribute 'train\_dialogue\_model'

**URL:** <https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877>\
**Category:** Rasa Open Source\
**Created:** [June 3, 2019, 2:11pm UTC](https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877 "2019-06-03T14:11:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiwo19](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tiwo19/32/2311_2.png) [@tiwo19](https://forum.rasa.com/u/tiwo19)\
**Post date:** [June 3, 2019, 2:11pm UTC](https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877/1 "2019-06-03T14:11:02Z")

</div>

**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’

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [June 19, 2019, 6:52am UTC](https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877/2 "2019-06-19T06:52:13Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![rajasingam7](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rajasingam7/32/4626_2.png) [@rajasingam7](https://forum.rasa.com/u/rajasingam7)\
**Post date:** [August 18, 2019, 5:47am UTC](https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877/3 "2019-08-18T05:47:15Z")

</div>

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:**

```auto
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:**

```auto
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

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [August 19, 2019, 8:49am UTC](https://forum.rasa.com/t/attributeerror-function-object-has-no-attribute-train-dialogue-model/10877/4 "2019-08-19T08:49:48Z")

</div>

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

> <https://github.com/RasaHQ/rasa/blob/master/examples/restaurantbot/run.py>

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