# Train\_core() return error AttributeError: 'str' object has no attribute 'get'

**URL:** <https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503>\
**Category:** Rasa Open Source\
**Created:** [October 26, 2019, 10:20pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503 "2019-10-26T22:20:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sousablde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sousablde/32/5708_2.png) [@sousablde](https://forum.rasa.com/u/sousablde)\
**Post date:** [October 26, 2019, 10:20pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/1 "2019-10-26T22:20:59Z")

</div>

Hello everyone, absolute newb in rasa and I keep getting an error when trying to train rasa.

this is the error message I am getting when running train\_core() and I don’t know where it is coming from:

AttributeError Traceback (most recent call last) in ----\> 1 train\_core()

in train\_core() 6 7 def train\_core(): ----\> 8 agent = Agent(example\_domain\_path, policies=[MemoizationPolicy(), KerasPolicy(), MappingPolicy()]) 9 10 loop = asyncio.get\_event\_loop()

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\agent.py in **init** (self, domain, policies, interpreter, generator, tracker\_store, lock\_store, action\_endpoint, fingerprint, model\_directory, model\_server, remote\_storage) 294 ): 295 # Initializing variables with the passed parameters. –\> 296 self.domain = self.\_create\_domain(domain) 297 self.policy\_ensemble = self.\_create\_ensemble(policies) 298

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\agent.py in \_create\_domain(domain) 832 833 if isinstance(domain, str): –\> 834 domain = Domain.load(domain) 835 domain.check\_missing\_templates() 836 return domain

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in load(cls, paths) 68 domain = Domain.empty() 69 for path in paths: —\> 70 other = cls.from\_path(path) 71 domain = domain.merge(other) 72

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in from\_path(cls, path) 78 79 if os.path.isfile(path): —\> 80 domain = cls.from\_file(path) 81 elif os.path.isdir(path): 82 domain = cls.from\_directory(path)

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in from\_file(cls, path) 91 @classmethod 92 def from\_file(cls, path: Text) -\> “Domain”: —\> 93 return cls.from\_yaml(rasa.utils.io.read\_file(path)) 94 95 @classmethod

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in from\_yaml(cls, yaml) 101 102 data = rasa.utils.io.read\_yaml(yaml) –\> 103 return cls.from\_dict(data) 104 105 @classmethod

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in from\_dict(cls, data) 106 def from\_dict(cls, data: Dict) -\> “Domain”: 107 utter\_templates = cls.collect\_templates(data.get(“templates”, {})) –\> 108 slots = cls.collect\_slots(data.get(“slots”, {})) 109 additional\_arguments = data.get(“config”, {}) 110 intents = data.get(“intents”, {})

C:\ProgramData\Anaconda3\lib\site-packages\rasa\core\domain.py in collect\_slots(slot\_dict) 193 slots = [] 194 for slot\_name in sorted(slot\_dict): –\> 195 slot\_class = Slot.resolve\_by\_type(slot\_dict[slot\_name].get(“type”)) 196 if “type” in slot\_dict[slot\_name]: 197 del slot\_dict[slot\_name][“type”]

AttributeError: ‘str’ object has no attribute ‘get’

Any help would be greatly appreciated, thank you for your time.

---

<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:** [October 29, 2019, 5:49pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/2 "2019-10-29T17:49:20Z")

</div>

hi @sousablde ! using `train_core` directly is pretty advanced. Is there a reason you don’t simply use `rasa train` on the command line?

---

<div class="post-metadata">

**Author:** ![sousablde](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sousablde/32/5708_2.png) [@sousablde](https://forum.rasa.com/u/sousablde)\
**Post date:** [October 30, 2019, 6:19pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/3 "2019-10-30T18:19:46Z")

</div>

hi @amn41 I tired quite a few times to use it but I never got it to work (even followed a bit of the weatherbot tutorial) so I ended up continuing through what worked further in the process.

I was able to fix it in the meantime, now just working on getting integration with a data set for it to actually work.

---

<div class="post-metadata">

**Author:** ![shena](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@shena](https://forum.rasa.com/u/shena)\
**Post date:** [January 23, 2020, 3:11pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/4 "2020-01-23T15:11:17Z")

</div>

hey, could you please provide how you solved the problem?

---

<div class="post-metadata">

**Author:** ![anilbg189](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@anilbg189](https://forum.rasa.com/u/anilbg189)\
**Post date:** [February 26, 2020, 6:07am UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/5 "2020-02-26T06:07:39Z")

</div>

Same problem occurs while running “rasa train” command in command line

---

<div class="post-metadata">

**Author:** ![mishra011](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mishra011/32/12639_2.png) [@mishra011](https://forum.rasa.com/u/mishra011)\
**Post date:** [June 23, 2020, 3:09pm UTC](https://forum.rasa.com/t/train-core-return-error-attributeerror-str-object-has-no-attribute-get/20503/6 "2020-06-23T15:09:55Z")

</div>

I had the same error , i found that of slots in the domain file was wrong indentation. Fix the indentation in domain file
