Open SreenijaK opened 4 years ago
Hi,
I'm getting same issue on macos with python 3.7.
File "/Users/endi/Projects/Endi/Rasa/rasa-demo/venv3/lib/python3.7/site-packages/rasa/utils/tensorflow/model_data.py", line 107, in number_of_examples f"Number of examples differs for keys '{data.keys()}'. Number of " ValueError: Number of examples differs for keys 'dict_keys(['text_features'])'. Number of examples should be the same for all data.
Try
pip install rasa==1.9.7 rasa train
It works for me.
The error is raised from def _create_model_data at diet_classifier.py
1.10.0
for example in training_data:
1.9.7
for e in training_data:
if label_attribute is None or e.get(label_attribute):
rasa-version: 1.10.4 python-version: Python 3.6.9 os: ubuntu 18.04
I'm following this tutorial https://blog.rasa.com/how-to-build-a-voice-assistant-with-open-source-rasa-and-mozilla-tools/
when i try 2.3 step : rasa train --augmentation 0
i get the following error. Training Core model... Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 525/525 [00:00<00:00, 728.31it/s, # trackers=1] Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 525/525 [00:28<00:00, 23.99it/s, # trackers=46] Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 525/525 [00:36<00:00, 14.37it/s, # trackers=50] Processed Story Blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 525/525 [00:35<00:00, 14.76it/s, # trackers=48] Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 939/939 [00:02<00:00, 393.22it/s, # actions=7549] 2020-07-02 11:44:21.885817: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303) Epochs: 0%| | 0/20 [00:00<?, ?it/s]/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/tensorflow/model_data.py:386: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray final_data[k].append(np.concatenate(np.array(v))) Epochs: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [04:04<00:00, 9.97s/it, t_loss=0.485, loss=0.129, acc=0.999] 2020-07-02 11:48:42 INFO rasa.utils.tensorflow.models - Finished training. Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 439/439 [00:00<00:00, 786.88it/s, # actions=1639] Processed actions: 1639it [00:00, 6310.55it/s, # examples=1639] Processed trackers: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 439/439 [00:00<00:00, 969.91it/s, # actions=939] 2020-07-02 11:48:47 INFO rasa.core.agent - Persisted model to '/tmp/tmpercnpaoi/core' Core model training completed. Training NLU model... 2020-07-02 11:48:47 INFO absl - Using /tmp/tfhub_modules to cache modules. 2020-07-02 11:48:47 INFO absl - Downloading TF-Hub Module 'http://models.poly-ai.com/convert/v1/model.tar.gz'. 2020-07-02 11:48:50 INFO absl - Downloaded http://models.poly-ai.com/convert/v1/model.tar.gz, Total size: 152.02MB 2020-07-02 11:48:50 INFO absl - Downloaded TF-Hub Module 'http://models.poly-ai.com/convert/v1/model.tar.gz'. /home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/common.py:363: UserWarning: Please configure the number of 'epochs' in your configuration file. We will change the default value of 'epochs' in the future to 1. 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Training data stats: 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Number of intent examples: 5277 (31 distinct intents) 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Found intents: 'switch', 'ask_which_events', 'explain', 'bye', 'thank', 'contact_sales', 'ask_how_contribute', 'greet', 'ask_question_in_forum', 'install_rasa', 'deny', 'nlu_info', 'technical_question', 'next_step', 'nlu_generation_tool_recommendation', 'chitchat', 'react_positive', 'affirm', 'react_negative', 'why_rasa', 'ask_why_contribute', 'out_of_scope', 'restart', 'pipeline_recommendation', 'signup_newsletter', 'human_handoff', 'canthelp', 'source_code', 'faq', 'enter_data', 'how_to_get_started' 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Number of response examples: 2357 (37 distinct responses) 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Number of entity examples: 956 (10 distinct entities) 2020-07-02 11:49:10 INFO rasa.nlu.training_data.training_data - Found entity types: 'product', 'nlu_part', 'job_function', 'location', 'language', 'company', 'current_api', 'entity', 'name', 'user_type' 2020-07-02 11:49:10 INFO rasa.nlu.model - Starting to train component ConveRTTokenizer 2020-07-02 11:49:56 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:49:56 INFO rasa.nlu.model - Starting to train component ConveRTFeaturizer Text batches: 0%| | 0/83 [00:00<?, ?it/s]/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/featurizers/dense_featurizer/convert_featurizer.py:129: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return np.array(final_embeddings) Text batches: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 83/83 [00:59<00:00, 1.21it/s] Response batches: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 37/37 [01:11<00:00, 1.13it/s] 2020-07-02 11:52:07 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:52:07 INFO rasa.nlu.model - Starting to train component RegexFeaturizer 2020-07-02 11:52:09 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:52:09 INFO rasa.nlu.model - Starting to train component LexicalSyntacticFeaturizer 2020-07-02 11:52:11 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:52:11 INFO rasa.nlu.model - Starting to train component CountVectorsFeaturizer /home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/common.py:363: UserWarning: The out of vocabulary token 'oov' was configured, but could not be found in any one of the NLU training examples. All unseen words will be ignored during prediction. More info at https://rasa.com/docs/rasa/nlu/components/#countvectorsfeaturizer /home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/common.py:363: UserWarning: The out of vocabulary token 'oov' was configured, but could not be found in any one of the ResponseSelector training examples. All unseen words will be ignored during prediction. More info at https://rasa.com/docs/rasa/nlu/components/#countvectorsfeaturizer 2020-07-02 11:52:17 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:52:17 INFO rasa.nlu.model - Starting to train component CountVectorsFeaturizer 2020-07-02 11:52:25 INFO rasa.nlu.model - Finished training component. 2020-07-02 11:52:25 INFO rasa.nlu.model - Starting to train component DIETClassifier /home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/classifiers/diet_classifier.py:589: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray X_dense = np.array(X_dense) Traceback (most recent call last): File "/home/sreenijak/python-envs/rasaenv/bin/rasa", line 8, in
sys.exit(main())
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/main.py", line 92, in main
cmdline_arguments.func(cmdline_arguments)
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/cli/train.py", line 76, in train
additional_arguments=extract_additional_arguments(args),
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/train.py", line 50, in train
additional_arguments=additional_arguments,
File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/train.py", line 101, in train_async
additional_arguments,
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/train.py", line 188, in _train_async_internal
additional_arguments=additional_arguments,
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/train.py", line 245, in _do_training
persist_nlu_training_data=persist_nlu_training_data,
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/train.py", line 482, in _train_nlu_with_validated_data
persist_nlu_training_data=persist_nlu_training_data,
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/train.py", line 90, in train
interpreter = trainer.train(training_data, kwargs)
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/model.py", line 191, in train
updates = component.train(working_data, self.config, context)
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/classifiers/diet_classifier.py", line 688, in train
model_data = self.preprocess_train_data(training_data)
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/classifiers/diet_classifier.py", line 669, in preprocess_train_data
label_attribute=label_attribute,
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/nlu/classifiers/diet_classifier.py", line 599, in _create_model_data
model_data.add_features(TEXT_FEATURES, [X_sparse, X_dense])
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/tensorflow/model_data.py", line 145, in add_features
self.num_examples = self.number_of_examples()
File "/home/sreenijak/python-envs/rasaenv/lib/python3.6/site-packages/rasa/utils/tensorflow/model_data.py", line 107, in number_of_examples
f"Number of examples differs for keys '{data.keys()}'. Number of "
ValueError: Number of examples differs for keys 'dict_keys(['text_features'])'. Number of examples should be the same for all data.