# Segmentation fault when using ner.batch-train

**URL:** <https://support.prodi.gy/t/segmentation-fault-when-using-ner-batch-train/604>\
**Category:** Uncategorized\
**Tags:** done, spacy\
**Created:** [June 11, 2018, 8:42pm UTC](https://support.prodi.gy/t/segmentation-fault-when-using-ner-batch-train/604 "2018-06-11T20:42:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klizter](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/klizter/32/86_2.png) [@klizter](https://support.prodi.gy/u/klizter)\
**Post date:** [June 11, 2018, 8:42pm UTC](https://support.prodi.gy/t/segmentation-fault-when-using-ner-batch-train/604/1 "2018-06-11T20:42:35Z")

</div>

Hey,

I’m getting a segmentation fault error when using `ner.batch-train`, any idea on how I can trace this issue?

```python
prodigy ner.batch-train domain_entities_annotations en_core_web_sm --output ./models/domain_entites --eval-split 0.2 --n-iter 25 --batch-size 32

Loaded model en_core_web_sm
Using 20% of accept/reject examples (357) for evaluation
Using 100% of remaining examples (10909) for training
Dropout: 0.2 Batch size: 32 Iterations: 25

BEFORE 0.014
Correct 4
Incorrect 276
Entities 4296
Unknown 4292

# LOSS RIGHT WRONG ENTS SKIP ACCURACY
01 58.564 107 174 36333 0 0.381
02 40.013 144 143 37429 0 0.502
03 37.137 161 126 37274 0 0.561
04 35.002 193 92 36999 0 0.677
05 33.377 210 75 36718 0 0.737
 89%|██████████████████████████████████████████████████████▏ | 9696/10909 [02:42<00:20, 59.80it/s]
/Users/*/*/*/env/bin/prodigy: line 1: 7146 Segmentation fault: 11 python -m prodigy "$@"

```

Thanks in advance! 😃

Update 2: Adding some context

```python
  ✨ Prodigy stats

  Version 1.5.0
  Location /Users/*/*/*/env/lib/python3.6/site-packages/prodigy
  Prodigy Home /Users/ocselvig/.prodigy
  Platform Darwin-17.6.0-x86_64-i386-64bit
  Python Version 3.6.5
  Database Name SQLite
  Database Id sqlite
  Total Datasets 15
  Total Sessions 77

```

Update 1: Setting up experiments on ubuntu sever to see what happens there.

---

<div class="post-metadata">

**Author:** ![honnibal](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/honnibal/32/35_2.png) [@honnibal](https://support.prodi.gy/u/honnibal)\
**Post date:** [June 12, 2018, 8:33am UTC](https://support.prodi.gy/t/segmentation-fault-when-using-ner-batch-train/604/2 "2018-06-12T08:33:31Z")

</div>

Fair question! Debugging segfaults is quite painful. Just to rule something out: could you check that you’re not running out of memory during training?

Failing that, you could set the batch size to 1, and hack the `ner.batch_train` recipe to use this subclass:

```python
from prodigy.models import EntityRecognizer

class DebugEntityRecognizer(EntityRecognizer):
    def _update(self, texts, *args, **kwargs):
        print(list(texts))
        return EntityRecognizer._update(self, texts, *args, **kwargs)

```

This will help figure out which sentence is failing. Sorry we don’t have a logging statement in the right place here!
