# Understanding train\_online.py

**URL:** <https://forum.rasa.com/t/understanding-train-online-py/142>\
**Category:** Rasa Open Source\
**Created:** [August 2, 2018, 7:07pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142 "2018-08-02T19:07:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahidalam](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nahidalam/32/91_2.png) [@nahidalam](https://forum.rasa.com/u/nahidalam)\
**Post date:** [August 2, 2018, 7:07pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/1 "2018-08-02T19:07:06Z")

</div>

I followed @Juste weatherbot tutorial and applying the knowledge for my own project.

And I am not sure I understand how `train_online.py` actually works.

When I type `hi`, the intent should be ‘`greet`’ but train\_online shows the intent is `hi`. Attached screenshot below

 ![42%20AM](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/1X/e46b26e2d7f67a11a11f8933e837eba2f015c734.png)

Why is that? When I actually run the bot using `dialogue_management_model.py`, this works fine as it recognizes the intent and replies with proper utterance.

Why is this difference? What am I missing?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [August 2, 2018, 7:08pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/2 "2018-08-02T19:08:30Z")

</div>

it looks like Rasa Core isn’t able to find your Rasa NLU model to start, that’s why it’s just taking the input as if it was the intent and entities directly. What command are you using to run? just `python train_online.py` ?

---

<div class="post-metadata">

**Author:** ![nahidalam](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nahidalam/32/91_2.png) [@nahidalam](https://forum.rasa.com/u/nahidalam)\
**Post date:** [August 2, 2018, 7:11pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/3 "2018-08-02T19:11:07Z")

</div>

```
if __name__ == ' __main__':
    logging.basicConfig(level="INFO")
    nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/renewalnlu')
    run_renewal_online(ConsoleInputChannel(), nlu_interpreter)

```

Thats strange. I have specified the NLU path properly.

---

<div class="post-metadata">

**Author:** ![nahidalam](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nahidalam/32/91_2.png) [@nahidalam](https://forum.rasa.com/u/nahidalam)\
**Post date:** [August 2, 2018, 7:13pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/4 "2018-08-02T19:13:36Z")

</div>

Yes just `sudo python train_online.py`

---

<div class="post-metadata">

**Author:** ![nahidalam](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nahidalam/32/91_2.png) [@nahidalam](https://forum.rasa.com/u/nahidalam)\
**Post date:** [August 2, 2018, 7:34pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/5 "2018-08-02T19:34:17Z")

</div>

@amn41 any thoughts on how to resolve it? It is impossible to debug without train\_online working and I have other issues.

I am using Rasa NLU 0.12.3 and Rasa Core version 0.9.8. Below `train_online` code

```
def run_renewal_online(input_channel, interpreter,
                          domain_file="renewal_domain.yml",
                          training_data_file='data/stories.md'):
    #agent = Agent(domain_file,policies=[MemoizationPolicy(), KerasPolicy()],interpreter=interpreter)
    agent = Agent(domain_file, policies=[AugmentedMemoizationPolicy(max_history=3), KerasPolicy()])
    data = agent.load_data(training_data_file)
    agent.train_online(data,
                       input_channel=input_channel,
                       max_history=2,
                       batch_size=50,
                       epochs=200,
                       max_training_samples=300)

    return agent

if __name__ == ' __main__':
    logging.basicConfig(level="INFO")
    nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/renewalnlu')
    run_renewal_online(ConsoleInputChannel(), nlu_interpreter)
```

---

<div class="post-metadata">

**Author:** ![nahidalam](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nahidalam/32/91_2.png) [@nahidalam](https://forum.rasa.com/u/nahidalam)\
**Post date:** [August 2, 2018, 7:57pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/6 "2018-08-02T19:57:12Z")

</div>

nevermind, found the issue. In the updated agent object, I didn’t include NLUInterpreter object.

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [August 5, 2018, 12:48pm UTC](https://forum.rasa.com/t/understanding-train-online-py/142/7 "2018-08-05T12:48:15Z")

</div>

glad to hear you found the issue!
