# Batch processing for segmenter tool

**URL:** https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143
**Category:** Segmenter
**Created:** [October 14, 2019, 6:24am UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143 "2019-10-14T06:24:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![amycaitriona](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@amycaitriona](https://forum.allencell.org/u/amycaitriona)
#### Post date: [October 14, 2019, 6:24am UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/1 "2019-10-14T06:24:37Z")

</div>

I am using your segmenter tool and it is working quite well so far, I was just wondering if there was an option for batch processing?

Thanks!

---

<div class="post-metadata">

### Author: ![jianxu\_chen](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jianxu\_chen](https://forum.allencell.org/u/jianxu_chen)
#### Post date: [October 14, 2019, 6:37am UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/2 "2019-10-14T06:37:08Z")

</div>

Yes, we do. You can find a tutorial here: [https://www.allencell.org/segmenter.html](https://www.allencell.org/segmenter.html) (see the youtube video in the middle of this page). More documentations are here: [https://github.com/AllenInstitute/aics-ml-segmentation/blob/master/docs/demo\_1.md](https://github.com/AllenInstitute/aics-ml-segmentation/blob/master/docs/demo_1.md)

Let me know if you have more questions 🙂

---

<div class="post-metadata">

### Author: ![amycaitriona](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@amycaitriona](https://forum.allencell.org/u/amycaitriona)
#### Post date: [October 16, 2019, 5:20am UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/3 "2019-10-16T05:20:46Z")

</div>

Super, thanks Jian Xu!

---

<div class="post-metadata">

### Author: ![amycaitriona](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@amycaitriona](https://forum.allencell.org/u/amycaitriona)
#### Post date: [May 1, 2020, 2:06pm UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/4 "2020-05-01T14:06:09Z")

</div>

Hi! I have successfully ran the segmenter with my samples and prepared the batch process using the template provided in the tutorial. However, when I open conda terminal I cannot run the batch processing script. It does not even allow me to run batch\_processing -h

Do you know what step I have forgotten in order for this to work?

Thanks!

---

<div class="post-metadata">

### Author: ![jianxu\_chen](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jianxu\_chen](https://forum.allencell.org/u/jianxu_chen)
#### Post date: [May 1, 2020, 2:30pm UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/5 "2020-05-01T14:30:49Z")

</div>

may i know which OS are you running on? and also how did install the package? build from source? one last question is within the conda environment, what will you get if you type in

pip show aicssegmentation

---

<div class="post-metadata">

### Author: ![amycaitriona](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@amycaitriona](https://forum.allencell.org/u/amycaitriona)
#### Post date: [May 1, 2020, 2:51pm UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/6 "2020-05-01T14:51:38Z")

</div>

I’m using windows. I installed following the instructions provided at the Bioimage informatics course. When I type pip show aicssegmentation I get this:  
segmenter) C:\>pip show aicssegmentation  
Name: aicssegmentation  
Version: 0.1.18.dev0  
Summary: Scripts for structure segmentation.  
Home-page: UNKNOWN  
Author: AICS  
Author-email: [jianxuc@alleninstitute.org](mailto:jianxuc@alleninstitute.org)  
License: Allen Institute Software License  
Location: c:\aics-segmentation  
Requires: numpy, scipy, scikit-image, pandas, aicsimageio, aicsimageprocessing, numba, itk  
Required-by:

when I try batch\_processing -h (or running the full batch processing code) I get a long error report:  
(segmenter) C:\>batch\_processing -h  
Traceback (most recent call last):  
File “C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\__init_\_.py”, line 584, in _build\_master  
ws.require( **requires** )  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 901, in require  
needed = self.resolve(parse\_requirements(requirements))  
File “C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\__init_\_.py”, line 792, in resolve  
raise VersionConflict(dist, req).with\_context(dependent\_req)  
pkg\_resources.ContextualVersionConflict: (aicsimageio 0.6.4 (c:\users\acochrane\anaconda3\envs\segmenter\lib\site-packages), Requirement.parse(‘aicsimageio\>=3.1.2’), {‘aicsimageprocessing’})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:\Users\acochrane\Anaconda3\envs\segmenter\Scripts\batch\_processing-script.py”, line 6, in   
from pkg\_resources import load\_entry\_point  
File “C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\__init_\_.py”, line 3258, in   
@_call\_aside  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 3242, in _call\_aside  
f(\*args, \*\*kwargs)  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 3271, in \_initialize\_master\_working\_set  
working\_set = WorkingSet._build\_master()  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 586, in \_build\_master  
return cls._build\_from\_requirements( **requires** )  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 599, in _build\_from\_requirements  
dists = ws.resolve(reqs, Environment())  
File "C:\Users\acochrane\Anaconda3\envs\segmenter\lib\site-packages\pkg\_resources\_init_.py", line 792, in resolve  
raise VersionConflict(dist, req).with\_context(dependent\_req)  
pkg\_resources.ContextualVersionConflict: (aicsimageio 0.6.4 (c:\users\acochrane\anaconda3\envs\segmenter\lib\site-packages), Requirement.parse(‘aicsimageio\>=3.1.2’), {‘aicsimageprocessing’})

---

<div class="post-metadata">

### Author: ![jianxu\_chen](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jianxu\_chen](https://forum.allencell.org/u/jianxu_chen)
#### Post date: [May 1, 2020, 9:25pm UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/7 "2020-05-01T21:25:20Z")

</div>

Thanks for providing the extra info.

A quick temporal solution:

Under directory c:\aics-segmentation\aicssegmentation\bin, you should be able to find a file: batch\_processing.py

Go to this directory and run

```
python batch_processing.py -h

```

this should work. `batch_processing` is just symbolic link to the command `python batch_processing.py` . Everything else is the same. You can pass the parameter as in the demo.

Meanwhile, I will try to reproduce the error on my end, and see what is the problem.

---

<div class="post-metadata">

### Author: ![amycaitriona](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@amycaitriona](https://forum.allencell.org/u/amycaitriona)
#### Post date: [May 5, 2020, 10:04am UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/8 "2020-05-05T10:04:30Z")

</div>

Thanks. This did provide a solution for recognizing batch\_processing however it is still not running the final code to run the batch.

There are many errors but I have noticed a recurring error with the version of aicsimageio version incompatibility but I have ran already pip install aicsimageio to make sure I have the most up to date version. Not sure if this is the/the only problem?

---

<div class="post-metadata">

### Author: ![jianxu\_chen](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@jianxu\_chen](https://forum.allencell.org/u/jianxu_chen)
#### Post date: [May 13, 2020, 4:05pm UTC](https://forum.allencell.org/t/batch-processing-for-segmenter-tool/143/9 "2020-05-13T16:05:36Z")

</div>

sorry for the late reply. Currently, our package is not compatible with the latest aicsimageio. aicsimageio just released some major update, but I have not got time to update our package accordingly.

A quick fix for you would be removing aicsimageio then `pip install aicsimage=0.6.4`

Actually, in our setup configuration, we require this when installing:

> <https://github.com/AllenInstitute/aics-segmentation/blob/master/setup.py#L60>
