# ERROR rasa.core.agent - Could not load model due to Error initializing graph component for node 'run\_classifiers.\[custom\_commponent\].\[CustomClass\]12

**URL:** <https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361>\
**Category:** Rasa Open Source\
**Created:** [January 1, 2022, 1:08am UTC](https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361 "2022-01-01T01:08:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hendler](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/hendler/32/17299_2.png) [@Hendler](https://forum.rasa.com/u/Hendler)\
**Post date:** [January 1, 2022, 1:08am UTC](https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361/1 "2022-01-01T01:08:45Z")

</div>

Not sure if this is a bug or something else is wrong, but when this worked in Rasa2 and has worked on and off in Rasa3.

It appears that modifying `config.yml` requires retraining, not just restarting. Each time there is a retrain, a custom component gets cached, and that cached version gets placed in `run_classifiers` module, and the name appended with an integer. However, the error occurred not only with custom component, but also with `LanguageModelFeaturizer`.

I’ve erased the whole cache at `.rasa` before retraining and the error still occurs. The `config.yml` looks like this, and all the other yml configs pass as valid yaml.

```auto
recipe: default.v1

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
# https://rasa.com/docs/rasa/components#languagemodelfeaturizer
language: en

pipeline:
  - name: SpacyNLP
    model: "en_core_web_md"
    # model: "en_core_web_lg"
  - name: SpacyTokenizer
  - name: SpacyEntityExtractor
  - name: SpacyFeaturizer
    pooling: mean
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
    constrain_similarities: true
    # model_confidence: cosine
    model_confidence: softmax
    # model_confidence: linear_norm
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 64
    constrain_similarities: true
  - name: FallbackClassifier
    threshold: 0.3
    ambiguity_threshold: 0.1
  - name: LanguageModelFeaturizer
    # Name of the language model to use
    model_name: "bert"
    # Pre-Trained weights to be loaded
    model_weights: "rasa/LaBSE"
    # An optional path to a specific directory to download and cache the pre-trained model weights.
    # The `default` cache_dir is the same as https://huggingface.co/transformers/serialization.html#cache-directory .
    cache_dir: null
 - name: "classifiers.custom_commponent.CustomClass"

```

I’ve added ` --force` to `rasa train`.

Any ideas why `LanguageModelFeaturizer` would also have some errors too?

---

<div class="post-metadata">

**Author:** ![Hendler](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/hendler/32/17299_2.png) [@Hendler](https://forum.rasa.com/u/Hendler)\
**Post date:** [January 1, 2022, 1:37am UTC](https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361/2 "2022-01-01T01:37:08Z")

</div>

`python -m rasa train core --force `

seems --force still loads from cache?

```auto
2021-12-31 17:32:44 INFO rasa.engine.training.hooks - Restored component 'MemoizationPolicy' from cache.
2021-12-31 17:32:44 INFO rasa.engine.training.hooks - Restored component 'RulePolicy' from cache.
2021-12-31 17:32:44 INFO rasa.engine.training.hooks - Restored component 'TEDPolicy' from cache.
2021-12-31 17:32:44 INFO rasa.engine.training.hooks - Restored component 'UnexpecTEDIntentPolicy' from cache.
Your Rasa model is trained and saved at 'models/core-20211231-173244-thin-fork.tar.gz'.

```

---

<div class="post-metadata">

**Author:** ![Hendler](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/hendler/32/17299_2.png) [@Hendler](https://forum.rasa.com/u/Hendler)\
**Post date:** [January 1, 2022, 2:12am UTC](https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361/3 "2022-01-01T02:12:33Z")

</div>

By modifying rasa `graph.py. _load_component()` I can see my component was raising an exception but it is intercepted by rasa and not displayed. Doesn’t explain `LanguageModelFeaturizer` issues though. I’ll try to understand this better and file a github issue.

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [February 14, 2022, 9:58pm UTC](https://forum.rasa.com/t/error-rasa-core-agent-could-not-load-model-due-to-error-initializing-graph-component-for-node-run-classifiers-custom-commponent-customclass-12/50361/4 "2022-02-14T21:58:04Z")

</div>

Can you explain more about how you were able to see the underlying component error?
