Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rasa1.7.1 segmentation fault(core dumped) #5228

Closed
gitpranjal opened this issue Feb 12, 2020 · 16 comments
Closed

Rasa1.7.1 segmentation fault(core dumped) #5228

gitpranjal opened this issue Feb 12, 2020 · 16 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@gitpranjal
Copy link

gitpranjal commented Feb 12, 2020

Rasa version:

Rasa SDK version (if used & relevant):

Rasa X version (if used & relevant):
1.7.1

Python version:
3.6.8

Operating system (windows, osx, ...):
Ubuntu18.04LTS

Issue:
Segmentation fault(core dumped) upon attempting to training the rasa core model

Error (including full traceback):

Segmentation fault (core dumped)

Command or request that led to error:

rasa train -c config_bluekaktus_-_manufacturing.yml --out models

Content of configuration file (config.yml) (if relevant):

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
- name: "SpacyNLP"
  case_sensitive: false
- name: "SpacyTokenizer"
- name: "CountVectorsFeaturizer"
  analyzer: 'word'
  min_ngram: 1
  max_ngram: 3
  lowercase: true
  OOV_token: oov
  return_sequence: true
- name: "SpacyFeaturizer"
  return_sequence: true
- name: "RegexFeaturizer"
  return_sequence: true
- name: "SpacyEntityExtractor"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "EmbeddingIntentClassifier"
  loss_type: "margin"
- name: "ResponseSelector"
- name: "retrieval_action_fallback.ResponseThreshold"


# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: "MemoizationPolicy"
    max_history: 81
  - name: "KerasPolicy"
    featurizer:
    - name: MaxHistoryTrackerFeaturizer
      max_history: 81
      state_featurizer:
        - name: BinarySingleStateFeaturizer
  - name: "MappingPolicy"
  - name: "FormPolicy"
  - name: "FallbackPolicy"
    nlu_threshold: 0.6
    core_threshold: 0.3
    fallback_action_name: "action_default_fallback"


importers:
- name: "RasaFileImporter"
- name: "my_training_data_importer.MyImporter"
  project_name: "bluekaktus_-_manufacturing"

Content of domain file (domain.yml) (if relevant):

@gitpranjal gitpranjal added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 12, 2020
@sara-tagger
Copy link
Collaborator

Thanks for raising this issue, @wochinge will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗

@erohmensing
Copy link
Contributor

@gitpranjal is this thread helpful at all? #5196

@gitpranjal
Copy link
Author

gitpranjal commented Feb 13, 2020

Yes that partially helped. Uninstalling gym and reinstalling a previous version solved the sementation fault.
pip uninstall gym
pip install gym==0.15.4

But it started giving Memory error. Hence the training worldn't start.
image

B/W, my OS is Ubuntu18.04 and rasa version is 1.7.1. Both the segmentation fault and Memory error don't come on windows but linux/ubuntu.

@erohmensing
Copy link
Contributor

erohmensing commented Feb 13, 2020

Got it. Yeah, the segmentation fault seems to only happen on Ubuntu based on the issues i've seen.

The rest seems like just a general memory error, how much memory does your machine have?

@benos
Copy link

benos commented Feb 16, 2020

I have the same problem when using the Docker images.

With this image, training works fine:
FROM rasa/rasa:1.7.0-spacy-en

With these, core training fails: (Segmentation fault right at the beginning of training core).
FROM rasa/rasa:1.7.1-spacy-en
FROM rasa/rasa:1.7.2-spacy-en

Tried boosting the RAM of Docker to 6GB with a 4GB swap but to no avail. Also, the failure happens at the exact same point regardless of the amount of RAM.

@wochinge
Copy link
Contributor

Thanks @benos That made it really easy to reproduce for me. I'll have a look

@wochinge wochinge added the area:rasa-oss 🎡 Anything related to the open source Rasa framework label Feb 17, 2020
@wochinge
Copy link
Contributor

wochinge commented Feb 17, 2020

Using python -q -X faulthandler I get this stack trace

Training Core model...
Processed Story Blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 1316.98it/s, # trackers=1]
Fatal Python error: Segmentation fault

Thread 0x00007fb7ca23d740 (most recent call first):
  File "/build/lib/python3.6/site-packages/rasa/core/utils.py", line 73 in subsample_array
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 482 in _create_start_trackers_for_augmentation
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 374 in generate
  File "/build/lib/python3.6/site-packages/rasa/core/training/__init__.py", line 69 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 672 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/train.py", line 65 in train
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 361 in _train_core_with_validated_data
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 223 in _do_training
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 188 in _train_async_internal
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 101 in train_async
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 50 in train
  File "/build/lib/python3.6/site-packages/rasa/cli/train.py", line 76 in train
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 76 in main
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 87 in <module>
  File "/usr/local/lib/python3.6/runpy.py", line 85 in _run_code
  File "/usr/local/lib/python3.6/runpy.py", line 193 in _run_module_as_main
Segmentation fault

Getting this in 1.7.2-full:

Fatal Python error: Segmentation fault

Thread 0x00007febb5427740 (most recent call first):
  File "/build/lib/python3.6/site-packages/rasa/core/events/__init__.py", line 98 in __init__
  File "/build/lib/python3.6/site-packages/rasa/core/events/__init__.py", line 366 in __init__
  File "/build/lib/python3.6/site-packages/rasa/core/events/__init__.py", line 422 in empty
  File "/build/lib/python3.6/site-packages/rasa/core/trackers.py", line 525 in _reset
Processed Story Blocks:   0%|                                                                                                             | 0/5 [00:00<?, ?it/s]Processed Story Blocks:   0%|                                                                                               | 0/5 [00:00<?, ?it/s, # trackers=5]
  File "/build/lib/python3.6/site-packages/rasa/core/trackers.py", line 437 in update
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 137 in update
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 98 in copy
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 530 in _process_step
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 290 in generate
Processed Story Blocks:   0%|                                                                                               | 0/5 [00:00<?, ?it/s, # trackers=5]it__.py", line 69 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 672 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/train.py", line 65 in train
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 361 in _train_core_with_validated_data
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 223 in _do_training
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 188 in _train_async_internal
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 101 in train_async
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 50 in train
  File "/build/lib/python3.6/site-packages/rasa/cli/train.py", line 76 in train
Processed Story Blocks:   0%|                                                                                               | 0/5 [00:00<?, ?it/s, # trackers=5]_main__.py", line 76 in main
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 87 in <module>
  File "/usr/local/lib/python3.6/runpy.py", line 85 in _run_code
  File "/usr/local/lib/python3.6/runpy.py", line 193 in _run_module_as_main
Fatal Python error: Segmentation fault

Thread 0x00007f20eda56740 (most recent call first):
  File "/usr/local/lib/python3.6/copy.py", line 88 in copy
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 98 in copy
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 493 in _create_start_trackers_for_augmentation
  File "/build/lib/python3.6/site-packages/rasa/core/training/generator.py", line 374 in generate
  File "/build/lib/python3.6/site-packages/rasa/core/training/__init__.py", line 69 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/agent.py", line 672 in load_data
  File "/build/lib/python3.6/site-packages/rasa/core/train.py", line 65 in train
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 361 in _train_core_with_validated_data
Processed Story Blocks:   0%|                                                                                                             | 0/5 [00:00<?, ?it/s]Processed Story Blocks:   0%|                                                                                               | 0/5 [00:00<?, ?it/s, # trackers=5]e-packages/rasa/train.py", line 223 in _do_training
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 188 in _train_async_internal
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 101 in train_async
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 50 in train
  File "/build/lib/python3.6/site-packages/rasa/cli/train.py", line 76 in train
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 76 in main
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 87 in <module>
  File "/usr/local/lib/python3.6/runpy.py", line 85 in _run_code

@wochinge
Copy link
Contributor

wochinge commented Feb 17, 2020

pip install gym==0.15.4 fixes it @erohmensing (the others don't work). Thanks for the pointer 👍
I also checked if it's related to pyglet but it isn't

@wochinge
Copy link
Contributor

I suggest pinning this to <=0.15.4. Research is removing the gym dependency with TF2.0 (cc @dakshvar22 )

@wochinge
Copy link
Contributor

i'm fixing the segmentation fault with #5248 .

@gitpranjal How much memory has your machine?

@wochinge wochinge mentioned this issue Feb 17, 2020
4 tasks
@gitpranjal
Copy link
Author

gitpranjal commented Feb 17, 2020 via email

@wochinge
Copy link
Contributor

And how much memory is consumed? Can you please monitor the memory consumption during the training with a tool like htop or similar

@gitpranjal
Copy link
Author

gitpranjal commented Feb 18, 2020 via email

@wochinge
Copy link
Contributor

In my config.yml file, max history is set to 251. It is getting killed at

This is a very very very large max_history. Any specific reason to set it that hight? Can you maybe give it a try with something in the range 3-10?

@gitpranjal
Copy link
Author

gitpranjal commented Feb 20, 2020 via email

@wochinge
Copy link
Contributor

I don't know your use case / story structure, but I would argue that this seems like an issue with the stories. I talked to a couple of colleagues and nobody has ever seen a max_history settings even close to it. I'm closing this issue since the segmentation fault is fixed and the max_history problem is a different thing. However, feel free to continue our discussion in here or in the Rasa Forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

5 participants