Could not load model due to Failed to find module 'rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer'

I am firing “docker-compose up” and getting the above error. please help me. Following is my config.yml file.

language: "en"
pipeline:
- name: "WhitespaceTokenizer"
  case_sensitive: false
- name: "CountVectorsFeaturizer"
  token_pattern: '(?u)\b\w+\b'
  max_ngram: 1
- name: "RegexFeaturizer"
- name: "EmbeddingIntentClassifier"

policies:
  - name: FormPolicy
  - name: FallbackPolicy
  - name: "KerasPolicy"
    featurizer:
    - name: MaxHistoryTrackerFeaturizer
      max_history: 10
      state_featurizer:
        - name: BinarySingleStateFeaturizer
    epochs: 500
    batch_size: 100
    validation_split: 0.2
  - name: "MemoizationPolicy"
    max_history: 5
  - name: "FallbackPolicy"
    nlu_threshold: 0.6
    core_threshold: 0.3
    fallback_action_name: "action_default_fallback"

Hi @sushilr007! A few questions:

  1. Which deployment method are you using? Docker Compose Quick Install with Rasa X, Docker-Compose Manual Install with Rasa X, or Rasa-Only Deployment with Docker Compose?

  2. Does it work outside of the Docker deployment?

  3. What version of Rasa Open Source are you using?

  1. Rasa-Only Deployment with Docker Compose

  2. Yes it is working outside the docker very well.

3)I am using the following versions. rasa:- 1.7.3 rasa-core-sdk:- 0.14.0 rasa-sdk :- 1.7.0

Here is my docker-compose file.

version: '3.0'
    services:
      rasa:
        image: rasa/rasa:latest-full
        ports:
          - "5005:5005"
        volumes:
          - ./:/app
          - ./models:/app/models
          - ./config:/app/config
        command:
          - run
          - --cors
          - "*"
          - -m
          - models
          - --enable-api
          - --endpoints
          - endpoints.yml
          - --debug
      action_server:
        image: rasa/rasa-sdk:latest
        volumes:
          - ./actions:/app/actions
        ports:
          - "5055:5055"

I have sent few details please check that.

Hi @sushilr007, thanks for the details. I will investigate and get back to you shortly.

Hi @sushilr007,

You mention that you are using rasa:- 1.7.3 rasa-core-sdk:- 0.14.0 rasa-sdk :- 1.7.0

So, in the docker-compose.yml, please specify those versions explicitly:

.
   image: rasa/rasa:1.7.3-full
.
.
   image: rasa/rasa-sdk:1.7.0

Let me know if docker-compose up works with those changes.

1 Like

@Arjaan

Hello now I am getting this type of traceback.

My action.py file is in actions folder.

Traceback (most recent call last): rasa_1 | File “/build/lib/python3.6/site-packages/rasa/core/actions/action.py”, line 549, in run rasa_1 | json=json_body, method=“post”, timeout=DEFAULT_REQUEST_TIMEOUT rasa_1 | File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 110, in next rasa_1 | return self.gen.send(None) rasa_1 | File “/build/lib/python3.6/site-packages/rasa/utils/endpoints.py”, line 150, in request rasa_1 | resp.status, resp.reason, await resp.content.read() rasa_1 | rasa.utils.endpoints.ClientResponseError: 404, Not Found, body=‘b’ {“error”:“No registered action found for name ‘action_clients’.”,“action_name”:“action_clients”}’’ rasa_1 | rasa_1 | The above exception was the direct cause of the following exception: rasa_1 | rasa_1 | Traceback (most recent call last): rasa_1 | File “/build/lib/python3.6/site-packages/rasa/core/processor.py”, line 599, in _run_action rasa_1 | events = await action.run(output_channel, nlg, tracker, self.domain) rasa_1 | File “/usr/local/lib/python3.6/asyncio/coroutines.py”, line 110, in next rasa_1 | return self.gen.send(None) rasa_1 | File “/build/lib/python3.6/site-packages/rasa/core/actions/action.py”, line 572, in run rasa_1 | raise Exception(“Failed to execute custom action.”) from e rasa_1 | Exception: Failed to execute custom action. rasa_1 | 2020-03-06 06:19:10 DEBUG rasa.core.processor - Action ‘action_clients’ ended with events ‘[]’.

Hi @sushilr007,

I suspect that one of the following is happening:

  • Your action.py is not loaded properly during startup of the rasa-sdk.
  • You do not have have a method name in your class that returns the string action_clients, as described here:
class ActionCheckRestaurants(Action):
   def name(self) -> Text:
      return "action_check_restaurants"

@Arjaan This is my action file. is this right?

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.events import SlotSet, AllSlotsReset, ConversationPaused, ConversationResumed from rasa_sdk.forms import FormAction from flask import Flask, render_template

class ActionClients(Action): 

    def name(self) -> Text:

        return "action_clients"

    def run(self, dispatcher: CollectingDispatcher,

            tracker: Tracker,

            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        csv_intents = data['Intents']

        csv_responses = data['Responses']

        rasa_intent=tracker.latest_message['intent'].get('name')

        for i in csv_intents.index:

            if rasa_intent == data['Intents'][i]:

                dispatcher.utter_message(data['Responses'][i])

        # data = csv.to_json()

        # print(data)

        return []

I was trying to deploy rasa on a server, I used conda to list my local package versions this is what it listed:

So I proceeded to install rasa 1.4.6 but when trying to start the server, faced the same error… could not load model. When I checked from Python shell: All I had to do to resolve it was pip install rasa==1.10.0

Hello I have the same issue. I have rasa 1.10.0 and rasa-sdk 1.10.1 . Did you find a way to resolve this? This happens only to my new custom actions which I made two days ago. All the other custom actions work perfect as they used to.