# UFRM: ValueError: invalid entry in choice array

**URL:** <https://community.naturalcapitalalliance.org/t/ufrm-valueerror-invalid-entry-in-choice-array/6316>\
**Category:** Software Support\
**Tags:** urban-flood\
**Created:** [January 9, 2026, 7:41pm UTC](https://community.naturalcapitalalliance.org/t/ufrm-valueerror-invalid-entry-in-choice-array/6316 "2026-01-09T19:41:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahi](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Rahi](https://community.naturalcapitalalliance.org/u/Rahi)\
**Post date:** [January 9, 2026, 7:41pm UTC](https://community.naturalcapitalalliance.org/t/ufrm-valueerror-invalid-entry-in-choice-array/6316/1 "2026-01-09T19:41:28Z")

</div>

#### While running the model error occuring, how to fix it? can someone please check and tell me what’s the problem?

#### 2026-01-10 01:34:08,054 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(540) ERROR exception encountered in raster\_calculator

Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 922, in \_lu\_to\_cn\_op  
File “numpy\_core\fromnumeric.py”, line 455, in choose  
File “numpy\_core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “pygeoprocessing\geoprocessing.py”, line 476, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 929, in \_lu\_to\_cn\_op  
ValueError: invalid entry in choice array  
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)  
2026-01-10 01:34:08,058 (pygeoprocessing.geoprocessing) geoprocessing.raster\_calculator(555) INFO Waiting for raster stats worker result.  
2026-01-10 01:34:08,058 (pygeoprocessing.geoprocessing\_core) threading.run(994) WARNING No valid pixels were received, sending None.  
2026-01-10 01:34:08,059 (taskgraph.Task) Task.add\_task(716) ERROR Something went wrong when adding task create Curve Number raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 922, in \_lu\_to\_cn\_op  
File “numpy\_core\fromnumeric.py”, line 455, in choose  
File “numpy\_core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “taskgraph\Task.py”, line 684, in add\_task  
File “taskgraph\Task.py”, line 1103, in \_call  
File “src/pygeoprocessing/geoprocessing\_core.pyx”, line 77, in pygeoprocessing.geoprocessing\_core.gdal\_use\_exceptions.wrapper  
File “src/pygeoprocessing/geoprocessing\_core.pyx”, line 78, in pygeoprocessing.geoprocessing\_core.gdal\_use\_exceptions.wrapper  
File “pygeoprocessing\geoprocessing.py”, line 476, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 929, in \_lu\_to\_cn\_op  
ValueError: invalid entry in choice array  
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)  
2026-01-10 01:34:08,061 (natcap.invest.utils) utils.prepare\_workspace(173) ERROR Exception while executing urban\_flood\_risk\_mitigation  
Traceback (most recent call last):  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 922, in \_lu\_to\_cn\_op  
File “numpy\_core\fromnumeric.py”, line 455, in choose  
File “numpy\_core\fromnumeric.py”, line 57, in \_wrapfunc  
ValueError: invalid entry in choice array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “natcap\invest\utils.py”, line 171, in prepare\_workspace  
File “natcap\invest\spec.py”, line 1937, in execute  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 368, in execute  
File “taskgraph\Task.py”, line 684, in add\_task  
File “taskgraph\Task.py”, line 1103, in \_call  
File “src/pygeoprocessing/geoprocessing\_core.pyx”, line 77, in pygeoprocessing.geoprocessing\_core.gdal\_use\_exceptions.wrapper  
File “src/pygeoprocessing/geoprocessing\_core.pyx”, line 78, in pygeoprocessing.geoprocessing\_core.gdal\_use\_exceptions.wrapper  
File “pygeoprocessing\geoprocessing.py”, line 476, in raster\_calculator  
File “natcap\invest\urban\_flood\_risk\_mitigation.py”, line 929, in \_lu\_to\_cn\_op  
ValueError: invalid entry in choice array  
Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)

[Damage\_loss\_table.csv](https://community.naturalcapitalalliance.org/uploads/short-url/qxBsCnWtJ7dvMYqFyTt2OI5HF30.csv) (199 Bytes)

[Biophysical\_water\_SF.csv](https://community.naturalcapitalalliance.org/uploads/short-url/boLrPOrmjf3JGIElrR6cKafoqww.csv) (199 Bytes)

[soil2.tif](https://community.naturalcapitalalliance.org/uploads/short-url/2KalFeo9OgxhpFlnCxp7UVEXnH7.tif) (10.7 KB)

###

---

<div class="post-metadata">

**Author:** ![swolny](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/swolny/32/181_2.png) [@swolny](https://community.naturalcapitalalliance.org/u/swolny)\
**Post date:** [January 12, 2026, 3:33pm UTC](https://community.naturalcapitalalliance.org/t/ufrm-valueerror-invalid-entry-in-choice-array/6316/2 "2026-01-12T15:33:21Z")

</div>

Hello @Rahi -

The error message says this:

> ValueError: invalid entry in choice array  
> Check that the Soil Group raster does not contain values other than (1, 2, 3, 4)

Your soil group raster does contain values other than (1,2,3,4), it contains the value 13. The [Data Needs](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest-userguide/latest/en/urban_flood_mitigation.html#data-needs) section of the User Guide specifies values of only (1,2,3,4). [The Data Sources Appendix](https://storage.googleapis.com/releases.naturalcapitalproject.org/invest-userguide/latest/en/urban_flood_mitigation.html#appendix-data-sources-and-guidance-for-parameter-selection) provides information about how to handle this.

~ Stacie

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/2X/8/8d95591aa074da87ea0fdd61ca47c1c3c0588aa7.png) [@system](https://community.naturalcapitalalliance.org/u/system)\
**Post date:** [January 19, 2026, 3:34pm UTC](https://community.naturalcapitalalliance.org/t/ufrm-valueerror-invalid-entry-in-choice-array/6316/3 "2026-01-19T15:34:04Z")

</div>

Closed on January 19, 2026, 3:34pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
