# ner.batch-train random Python has stopped/Segmentation Fault

**URL:** <https://support.prodi.gy/t/ner-batch-train-random-python-has-stopped-segmentation-fault/834>\
**Category:** Uncategorized\
**Tags:** ner, done, windows\
**Created:** [September 21, 2018, 7:59pm UTC](https://support.prodi.gy/t/ner-batch-train-random-python-has-stopped-segmentation-fault/834 "2018-09-21T19:59:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jprusa](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jprusa](https://support.prodi.gy/u/jprusa)\
**Post date:** [September 21, 2018, 7:59pm UTC](https://support.prodi.gy/t/ner-batch-train-random-python-has-stopped-segmentation-fault/834/1 "2018-09-21T19:59:35Z")

</div>

When training a model with ner.batch-train on both window and linux, the process fails randomly. On linux this results in a segmentation fault error, on Windows a popup tells me python has stopped. I have checked that I am not running out of ram. Batch size does not appear to have any impact on this issue, though I have no run it for multiple iterations with a batch size of 1 due to how slow it is.

I am unable to find any trigger for the problem. Sometimes training is able to complete 10+ epochs without issues, other times a segmentation fault occurs in the first few epochs, or even before completion of the first epoch.

EDIT: I have now ran ner.batch-train with a batch size of 1, as suggested in some related topics. It still results in a segmentation fault.

---

<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:** [September 24, 2018, 6:51pm UTC](https://support.prodi.gy/t/ner-batch-train-random-python-has-stopped-segmentation-fault/834/2 "2018-09-24T18:51:12Z")

</div>

This is most likely a bug in spaCy, which I think I’m getting close to resolving. But if you have a chance, see if you can find a single document that it fails consistently on? If you do, and you’re able to email me the document, it would definitely be helpful. Otherwise, I’ll update this thread when I know more.
