An Unofficial Guide to Installing Rasa on an M1 Macbook

hi @itsjhonny !

I successfully installed Rasa on my M1 based on your guide, following up from this thread. Thank you! However, I am running into this when I run rasa train over on terminal:

I am not able to interact with the bot after running rasa shell in the terminal. What am I doing wrong?

Metal device set to: Apple M1

systemMemory: 8.00 GB
maxCacheSize: 2.67 GB

/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/rasa/utils/tensorflow/model_data.py:750: 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
  np.concatenate(np.array(f)),
Epochs: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 100/100 [00:22<00:00,  4.47it/s, t_loss=1.27, i_acc=0.986]
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component EntitySynonymMapper
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component ResponseSelector
2022-07-21 11:40:13 INFO     rasa.nlu.selectors.response_selector  - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Starting to train component FallbackClassifier
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Finished training component.
2022-07-21 11:40:13 INFO     rasa.nlu.model  - Successfully saved model into '/var/folders/rt/4dsv7dh93zbdjyj0hzvg12r00000gn/T/tmp525_f13q/nlu'
NLU model training completed.
Training Core model...
2022-07-21 11:40:20 WARNING  rasa.utils.common  - Failed to write global config. Error: [Errno 13] Permission denied: '/Users/karan/.config/rasa'. Skipping.
2022-07-21 11:40:20 WARNING  rasa.shared.utils.common  - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future πŸ”¬ Please share your feedback on it in the forum (https://forum.rasa.com) to help us make this feature ready for production.
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3355.44it/s, # trackers=1]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 1581.17it/s, # trackers=3]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 381.44it/s, # trackers=12]
Processed story blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 93.69it/s, # trackers=39]
Processed rules: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 5679.49it/s, # trackers=1]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3057.82it/s, # action=12]
Processed actions: 12it [00:00, 15582.55it/s, # examples=12]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 5302.53it/s, # action=5]
Processed actions: 5it [00:00, 31823.25it/s, # examples=4]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3/3 [00:00<00:00, 3192.01it/s, # action=12]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2/2 [00:00<00:00, 3502.55it/s]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:00<00:00, 2430.64it/s]
Processed trackers: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 120/120 [00:00<00:00, 5289.16it/s, # intent=12]
/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/rasa/utils/tensorflow/model_data_utils.py:383: 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
  np.array(values), number_of_dimensions=4
Epochs:   0%|                                           | 0/100 [00:00<?, ?it/s]/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/tensorflow/python/framework/indexed_slices.py:448: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
/opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/site-packages/tensorflow/python/framework/indexed_slices.py:448: UserWarning: Converting sparse IndexedSlices(IndexedSlices(indices=Tensor("gradients/cond_1_grad/Identity_1:0", shape=(None,), dtype=int64), values=Tensor("gradients/cond_1_grad/Identity:0", shape=(None,), dtype=float32), dense_shape=Tensor("gradients/cond_1_grad/Identity_2:0", shape=(1,), dtype=int32))) to a dense Tensor of unknown shape. This may consume a large amount of memory.
  warnings.warn(
2022-07-21 11:40:28.403487: F tensorflow/core/framework/tensor.cc:681] Check failed: IsAligned() ptr = 0x2bea09910
zsh: abort      rasa train
(rasadev) [email protected] development % /opt/homebrew/Caskroom/miniforge/base/envs/rasadev/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d ''```

running rasa shell results in this

How can I install spacy models?

I could use the miniforge env above to install spacy 3.2.2, it seems there’s no issue. But the issue is now on actually training and running rasa for me :upside_down_face:

I think this is due to resource problem? Maybe you can try with a smaller training set.

Shouldn’t

conda activate rasa2-8

be called before calling the pip install ... commands?

Is there a way to install Rasa X? Or is that still a no for the M1 chip.

Created a repo with a step-by-step quickstart document here (for rasa 2.8.27)

1 Like
ERROR: Failed building wheel for xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects

failed
Traceback (most recent call last):
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda/exceptions.py", line 1129, in __call__
    return func(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/cli/main.py", line 80, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda/notices/core.py", line 72, in wrapper
    return_value = func(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/cli/main_create.py", line 156, in execute
    result[installer_type] = installer.install(prefix, pkg_specs, args, env)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 70, in install
    return _pip_install_via_requirements(*args, **kwargs)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/installers/pip.py", line 53, in _pip_install_via_requirements
    stdout, stderr = pip_subprocess(pip_cmd, prefix, cwd=pip_workdir)
  File "/Users/faridzuan/miniforge3/lib/python3.10/site-packages/conda_env/pip_util.py", line 41, in pip_subprocess
    raise CondaEnvException("Pip failed")
conda.exceptions.CondaEnvException: Pip failed

This is the error im facing during conda enviroment creation

Hi @WTFFARIDZ, please take a look at Rasa Open Source 3.3 launched

1 Like

Thank you sharing it here.

Does anyone have ways to install Rasa Open Source 3.2X on M1 ?