ModuleNotFoundError: Cannot find class 'DIETClassifier' from global namespace

while training my model i get this import error.

rasa-worker_1      |     return class_from_module_path(component_name)
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/utils/common.py", line 211, in class_from_module_path
rasa-worker_1      |     raise ImportError(f"Cannot retrieve class from path {module_path}.")
rasa-worker_1      | ImportError: Cannot retrieve class from path DIETClassifier.
rasa-worker_1      | 
rasa-worker_1      | During handling of the above exception, another exception occurred:
rasa-worker_1      | 
rasa-worker_1      | Traceback (most recent call last):
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/server.py", line 799, in train
rasa-worker_1      |     None, functools.partial(train_model, **info)
rasa-worker_1      |   File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
rasa-worker_1      |     result = self.fn(*self.args, **self.kwargs)
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/train.py", line 50, in train
rasa-worker_1      |     additional_arguments=additional_arguments,
rasa-worker_1      |   File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/train.py", line 101, in train_async
rasa-worker_1      |     additional_arguments,
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/train.py", line 188, in _train_async_internal
rasa-worker_1      |     additional_arguments=additional_arguments,
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/train.py", line 245, in _do_training
rasa-worker_1      |     persist_nlu_training_data=persist_nlu_training_data,
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/train.py", line 474, in _train_nlu_with_validated_data
rasa-worker_1      |     persist_nlu_training_data=persist_nlu_training_data,
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/nlu/train.py", line 74, in train
rasa-worker_1      |     trainer = Trainer(nlu_config, component_builder)
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/nlu/model.py", line 144, in __init__
rasa-worker_1      |     components.validate_requirements(cfg.component_names)
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/nlu/components.py", line 39, in validate_requirements
rasa-worker_1      |     component_class = registry.get_component_class(component_name)
rasa-worker_1      |   File "/build/lib/python3.6/site-packages/rasa/nlu/registry.py", line 181, in get_component_class
rasa-worker_1      |     raise ModuleNotFoundError(exception_message)
rasa-worker_1      | ModuleNotFoundError: Cannot find class 'DIETClassifier' from global namespace. Please check that there is no typo in the class name and that you have imported the class into the global namespace.
rasa-worker_1      | ```

I am running rasa 1.7.4

Which Rasa Open Source version are you using? And can you please share the content of your config.yml? :pray:

Did we get the solution for this issue, I am also stuck with the same problem ?

I am using Rasa 2.2.6 the latest version …

1 Like