# Trying to get started! nlu\_model problem

**URL:** <https://forum.rasa.com/t/trying-to-get-started-nlu-model-problem/6664>\
**Category:** Getting Started with Rasa\
**Created:** [April 4, 2019, 8:26am UTC](https://forum.rasa.com/t/trying-to-get-started-nlu-model-problem/6664 "2019-04-04T08:26:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yannic](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@Yannic](https://forum.rasa.com/u/Yannic)\
**Post date:** [April 4, 2019, 8:26am UTC](https://forum.rasa.com/t/trying-to-get-started-nlu-model-problem/6664/1 "2019-04-04T08:26:41Z")

</div>

Hello. I am completly new in this Topic. I was trying to get started with the Rasa Stack with the Video: [YouTube](https://www.youtube.com/watch?v=xu6D_vLP5vY&t=514s) . Sadly there have been changes in the nlu\_model.py file. I tryed the old Version as seen in the Video such as the new one. Sadly it won’t work for me.

This is my nlu\_model.py file: from rasa\_nlu.training\_data import load\_data

from rasa\_nlu import config

from rasa\_nlu.model import Trainer

def train\_nlu(data, config, model\_dir):

training\_data = load\_data(data)

trainer = Trainer(config.load(configs))

trainer.train(training\_data)

model\_directory = trainer.persist(model\_dir, fixed\_model\_name = ‘weathernlu’)

if **name** == ‘ **main** ’:

train\_nlu(’./data/data.json’, ‘config\_spacy.json’, ‘./models/nlu’)

and this is my Shell Output: C:\Users\Yannic\Documents\Waetherbot\>python nlu\_model.py Traceback (most recent call last): File “nlu\_model.py”, line 12, in train\_nlu(’./data/data.json’, ‘config\_spacy.json’, ‘./models/nlu’) File “nlu\_model.py”, line 7, in train\_nlu trainer = Trainer(config.load(configs)) AttributeError: ‘str’ object has no attribute ‘load’

I really hope i can get some help.

---

<div class="post-metadata">

**Author:** ![Yannic](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@Yannic](https://forum.rasa.com/u/Yannic)\
**Post date:** [April 9, 2019, 9:49am UTC](https://forum.rasa.com/t/trying-to-get-started-nlu-model-problem/6664/2 "2019-04-09T09:49:26Z")

</div>

`config` is a module imported from `rasa_nlu` , however you are shadowing it with the parameter `config` in the function. I think you meant to name your function parameter `configs` .

from rasa\_nlu.training\_data import load\_data from rasa\_nlu import config from rasa\_nlu.model import Trainer

def train\_nlu(data, configs, model\_dir): training\_data = load\_data(data) trainer = Trainer(config.load(configs)) trainer.train(training\_data) model\_directory = trainer.persist(model\_dir, fixed\_model\_name = ‘weathernlu’)

if **name** == ‘ **main** ’: train\_nlu(‘./data/data.json’, ‘config\_spacy.json’, ‘./models/nlu’) This is the solution i got . Credits to [DobromirM](https://stackoverflow.com/users/5853611/dobromirm)

> <https://stackoverflow.com/questions/55532696/rasa-nlu-model-is-not-working-attributeerror-str-object-has-no-attribute-lo>

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [April 16, 2019, 4:47pm UTC](https://forum.rasa.com/t/trying-to-get-started-nlu-model-problem/6664/3 "2019-04-16T16:47:49Z")

</div>

Thanks for posting the solution to your problem as well!
