# Attribute Error for Medcat Trainer

**URL:** <https://discourse.cogstack.org/t/attribute-error-for-medcat-trainer/234>\
**Category:** MedCAT\
**Created:** [August 22, 2023, 3:31pm UTC](https://discourse.cogstack.org/t/attribute-error-for-medcat-trainer/234 "2023-08-22T15:31:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveC](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@DaveC](https://discourse.cogstack.org/u/DaveC)\
**Post date:** [August 22, 2023, 3:31pm UTC](https://discourse.cogstack.org/t/attribute-error-for-medcat-trainer/234/1 "2023-08-22T15:31:50Z")

</div>

Hi  
I’ve been trying to run Medcat trainer (v2.9.0) on my SLAM machine via docker. It starts out fine, but after I create a new project and open it to start annotations I get the following error:  
AttributeError: ‘General’ has no attribute ‘cui\_count\_limit’  
This is caused by the line cui\_count\_limit = cat.config.general.get(“cui\_count\_limit”,-1). I wondered if there was anything I should or shouldn’t have done that could cause this error.  
Thanks!

---

<div class="post-metadata">

**Author:** ![mart.ratas](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mart.ratas](https://discourse.cogstack.org/u/mart.ratas)\
**Post date:** [August 23, 2023, 1:43pm UTC](https://discourse.cogstack.org/t/attribute-error-for-medcat-trainer/234/2 "2023-08-23T13:43:58Z")

</div>

Looks like this one’s my bad. I’ve got to make a fix for this on MedCAT side. It’s odd though that this came out only now since the change was introduced in September of last year and released in October in version 1.4.0.

In any case, I’ll post a PR for this shortly.  
EDIT:  
PR now up:

> <https://github.com/CogStack/MedCAT/pull/341>
>
> More specifically the get method which was not able to return default values for… non-existant keys.
> 
> This PR will make sure the \`\_\_getitem\_\_\` method of \`FakeDict\` will raise a \_KeyError\_ as would be expected for a \_dict\_ instead of an \_AttributionError\_ (which was the case up until now).
> This will ensure that the \`FakeDict.get\` method will catch the correct exception in the \`except\` clause.
> 
> Issue raised here:
> https://discourse.cogstack.org/t/attribute-error-for-medcat-trainer/234
