# Urban Flood Mitigation Error - ValueError: invalid entry in choice array

**URL:** <https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814>\
**Category:** Software Support\
**Tags:** urban-flood\
**Created:** [February 18, 2020, 4:35pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814 "2020-02-18T16:35:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![EcoEvans](https://avatars.discourse-cdn.com/v4/letter/e/7c8e57/32.png) [@EcoEvans](https://community.naturalcapitalalliance.org/u/EcoEvans)\
**Post date:** [February 18, 2020, 4:35pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/1 "2020-02-18T16:35:22Z")

</div>

Hello,

I keep having trouble when using the Urban Flood Mitigation module. I get ‘ValueError: invalid entry in choice array’

As far as I can tell from the log, it is something to do with not being able to create a cn raster, which I assume relates to the CN curve.

I have tested the biophysical parameter table that I produced with the sample data supplied with the InVEST model and that worked, so I don’t think the table can be wrong. I have also made sure that the projections are the same for all spatial data, and that the formats are the same as the sample data.

Could you help me figure out what else it may be please? The log is below:

2020-02-18 16:11:12,297 utils.prepare\_workspace(115) INFO Writing log messages to C:/Users/Pevans/Dropbox/CEH/FM/Runs\InVEST-UrbanFloodRiskMitigation-log-2020-02-18–16\_11\_12.txt  
2020-02-18 16:11:12,315 model.\_logged\_target(1642) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_flood\_risk\_mitigation 3.8.0:  
aoi\_watersheds\_path C:/Users/Pevans/Dropbox/CEH/FM/Watersheds/waterss.shp  
built\_infrastructure\_vector\_path xx/Infrastructure/ND\_buildingsType.shp  
curve\_number\_table\_path xx/UrbanFloodMitigation/Biophysical\_water\_SF.csv  
infrastructure\_damage\_loss\_table\_path xx/flood\_damage.csv  
lulc\_path xx/LC/ND3.tif  
n\_workers -1  
rainfall\_depth 900  
results\_suffix ND1\_data1  
soils\_hydrological\_group\_raster\_path xx/HOST/HOST3.tif  
workspace\_dir xx/Runs

2020-02-18 16:11:12,845 geoprocessing.raster\_calculator(375) INFO starting stats\_worker  
2020-02-18 16:11:12,847 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-61, started daemon 332)\>  
2020-02-18 16:11:12,862 threading.run(870) DEBUG payload is None, terminating  
2020-02-18 16:11:12,862 geoprocessing.raster\_calculator(486) INFO Waiting for raster stats worker result.  
2020-02-18 16:11:12,863 threading.run(870) WARNING No valid pixels were received, sending None.  
2020-02-18 16:11:12,863 Task.add\_task(641) ERROR Something went wrong when adding task create cn raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 829, in \_lu\_to\_cn\_op  
File “\< **array\_function** internals\>”, line 6, in choose  
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose  
File “site-packages\numpy\core\fromnumeric.py”, line 61, in \_wrapfunc  
ValueError: invalid entry in choice array  
2020-02-18 16:11:12,868 model.\_logged\_target(1648) ERROR Exception while executing \<function execute at 0x0B1CA978\>  
Traceback (most recent call last):  
File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 250, in execute  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 829, in \_lu\_to\_cn\_op  
File “\< **array\_function** internals\>”, line 6, in choose  
File “site-packages\numpy\core\fromnumeric.py”, line 433, in choose  
File “site-packages\numpy\core\fromnumeric.py”, line 61, in \_wrapfunc  
ValueError: invalid entry in choice array  
2020-02-18 16:11:12,872 model.\_logged\_target(1651) INFO Execution finished  
2020-02-18 16:11:12,881 utils.prepare\_workspace(121) INFO Elapsed time: 0.58s

Thanks in advance

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [February 18, 2020, 11:59pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/2 "2020-02-18T23:59:58Z")

</div>

Hi there, thanks for posting.

I was able to reproduce this error when I used a `Soils Hydrological Group Raster` that included values outside the acceptable values of `1, 2, 3, 4`. Could you check your raster and see if there are pixel values other than those?

I see that this data requirement is not well-documented in the User’s Guide, so I’ll be sure to fix that. We can also provide a more descriptive error message for this case in the future.

---

<div class="post-metadata">

**Author:** ![EcoEvans](https://avatars.discourse-cdn.com/v4/letter/e/7c8e57/32.png) [@EcoEvans](https://community.naturalcapitalalliance.org/u/EcoEvans)\
**Post date:** [February 19, 2020, 11:58am UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/3 "2020-02-19T11:58:21Z")

</div>

Hi Dave,

Thanks for the quick reply and help.

The first problem has been fixed; it was to do with the Hydrological Group Raster – I had NoData values as part of the raster, which  
looks like it caused the error.

However, I now have another error, the log of which is below. This time it just says KeyError 2.0., so I am having difficulty understanding  
what that specifically relates to.

Any help would be appreciated.

Thank you

2020-02-19 11:48:32,752 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 1 of 2 aligned: aligned\_lulc\_ND1\_host3.tif

2020-02-19 11:48:34,696 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 2 of 2 aligned: aligned\_soils\_hydrological\_group\_ND1\_host3.tif

2020-02-19 11:48:34,697 geoprocessing.align\_and\_resize\_raster\_stack(754) INFO aligned all 2 rasters.

2020-02-19 11:48:35,473 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:35,486 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-12, started daemon 5764)\>

2020-02-19 11:48:36,277 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:36,277 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:36,278 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:36,277 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:37,018 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:37,025 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-13, started daemon 24416)\>

2020-02-19 11:48:37,270 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:37,271 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:37,271 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:37,271 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:37,843 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:37,846 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-14, started daemon 16644)\>

2020-02-19 11:48:38,139 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:38,140 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:38,140 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:38,140 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:38,749 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:38,752 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-15, started daemon 21024)\>

2020-02-19 11:48:38,999 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:39,000 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:39,001 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:39,000 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:39,636 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:39,639 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-16, started daemon 8528)\>

2020-02-19 11:48:39,837 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:39,837 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:39,838 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:39,838 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:40,485 geoprocessing.raster\_calculator(375) INFO starting stats\_worker

2020-02-19 11:48:40,489 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-17, started daemon 18060)\>

2020-02-19 11:48:40,684 geoprocessing.raster\_calculator(454) INFO 100.0%% complete

2020-02-19 11:48:40,685 geoprocessing.raster\_calculator(457) INFO signaling stats worker to terminate

2020-02-19 11:48:40,686 threading.run(870) DEBUG payload is None, terminating

2020-02-19 11:48:40,685 geoprocessing.raster\_calculator(459) INFO Waiting for raster stats worker result.

2020-02-19 11:48:41,310 urban\_flood\_risk\_mitigation.\_build\_affected\_vector(619) WARNING C:/Users/Pevans/Dropbox/CEH/FM/Runs\temp\_working\_dir\_not\_for\_humans\intermediate\_flood\_risk\_service\_ND1\_host3.gpkg  
exists, removing to make a current one

2020-02-19 11:48:41,524 geoprocessing.reproject\_vector(1640) INFO starting reprojection

2020-02-19 11:48:42,249 geoprocessing.reproject\_vector(1683) INFO reprojection 100.0% complete on intermediate\_flood\_risk\_service\_ND1\_host3.gpkg

2020-02-19 11:48:42,414 urban\_flood\_risk\_mitigation.\_build\_affected\_vector(650) INFO building infrastructure lookup dict

2020-02-19 11:48:42,416 Task.add\_task(641) ERROR Something went wrong when adding task build affected vector (7), terminating taskgraph.

Traceback (most recent call last):

File “site-packages\taskgraph\Task.py”, line 607, in add\_task

File “site-packages\taskgraph\Task.py”, line 1071, in \_call

File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 661, in \_build\_affected\_vector

KeyError: 2.0

2020-02-19 11:48:42,419 model.\_logged\_target(1648) ERROR Exception while executing \<function execute at 0x0BACA978\>

Traceback (most recent call last):

File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target

File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 347, in execute

File “site-packages\taskgraph\Task.py”, line 607, in add\_task

File “site-packages\taskgraph\Task.py”, line 1071, in \_call

File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 661, in \_build\_affected\_vector

KeyError: 2.0

2020-02-19 11:48:42,422 model.\_logged\_target(1651) INFO Execution finished

2020-02-19 11:48:42,429 utils.prepare\_workspace(121) INFO Elapsed time: 11.3s

---

<div class="post-metadata">

**Author:** ![EcoEvans](https://avatars.discourse-cdn.com/v4/letter/e/7c8e57/32.png) [@EcoEvans](https://community.naturalcapitalalliance.org/u/EcoEvans)\
**Post date:** [February 19, 2020, 12:28pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/4 "2020-02-19T12:28:37Z")

</div>

The second error was produced because I forgot to change the ‘Potential damage loss for each building type’ csv when I simplified it to try and work out the cause of the first error!

Thanks for you answer again.

---

<div class="post-metadata">

**Author:** ![dave](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dave/32/70_2.png) [@dave](https://community.naturalcapitalalliance.org/u/dave)\
**Post date:** [February 19, 2020, 6:03pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/5 "2020-02-19T18:03:27Z")

</div>

Glad to hear it!

Yep, `KeyErrors` in InVEST tend to indicate missing row/column headers in CSV inputs. Glad you figured that out!

---

<div class="post-metadata">

**Author:** ![kblann](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kblann](https://community.naturalcapitalalliance.org/u/kblann)\
**Post date:** [April 7, 2020, 9:50pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/6 "2020-04-07T21:50:07Z")

</div>

Hi, I just started trying to run the Urban Flood Mitigation model today. I have my curve number table, HSG raster, and land use raster (no infrastructure data). I got the following errors partway through:  
020-04-07 16:38:36,094 Task.add\_task(641) ERROR Something went wrong when adding task create cn raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 816, in \_lu\_to\_cn\_op  
File “site-packages\scipy\sparse\_index.py”, line 35, in **getitem**  
File “site-packages\scipy\sparse\_index.py”, line 139, in \_validate\_indices  
File “site-packages\scipy\sparse\_index.py”, line 171, in \_asindices  
IndexError: index (128) out of range  
2020-04-07 16:38:36,094 model.\_logged\_target(1648) ERROR Exception while executing \<function execute at 0x0DF3A9C0\>  
Traceback (most recent call last):  
File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 250, in execute  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 816, in \_lu\_to\_cn\_op  
File “site-packages\scipy\sparse\_index.py”, line 35, in **getitem**  
File “site-packages\scipy\sparse\_index.py”, line 139, in \_validate\_indices  
File “site-packages\scipy\sparse\_index.py”, line 171, in \_asindices  
IndexError: index (128) out of range  
2020-04-07 16:38:36,094 model.\_logged\_target(1651) INFO Execution finished  
2020-04-07 16:38:36,094 utils.prepare\_workspace(121) INFO Elapsed time: 7m 51.420000000000016s

---

<div class="post-metadata">

**Author:** ![kblann](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@kblann](https://community.naturalcapitalalliance.org/u/kblann)\
**Post date:** [April 7, 2020, 9:51pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/7 "2020-04-07T21:51:26Z")

</div>

I didn’t copy all the lines, perhaps I should have just copied the whole log:

2020-04-07 16:30:44,673 utils.prepare\_workspace(115) INFO Writing log messages to C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\InVEST-UrbanFloodRiskMitigation-log-2020-04-07–16\_30\_44.txt  
2020-04-07 16:30:44,674 model.\_logged\_target(1642) Level 100 Starting model with parameters:  
Arguments for InVEST natcap.invest.urban\_flood\_risk\_mitigation 3.8.0:  
aoi\_watersheds\_path C:/ESRI/GISDATA/Dakotas/BigSioux/hydrography/huc04\_bs.shp  
built\_infrastructure\_vector\_path  
curve\_number\_table\_path C:/InVEST\_3.7.0\_x86/seasonal\_water\_yield/curvenumber.csv  
infrastructure\_damage\_loss\_table\_path  
lulc\_path C:/ESRI/GISDATA/Dakotas/BigSioux/LULC/nlcd2016utm.tif  
n\_workers -1  
rainfall\_depth 25  
results\_suffix 1  
soils\_hydrological\_group\_raster\_path C:/ESRI/GISDATA/Dakotas/BigSioux/Soils/HSG\_utm.tif  
workspace\_dir C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace

2020-04-07 16:30:54,142 geoprocessing.logger\_callback(3239) INFO Warp 2.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:03,642 geoprocessing.logger\_callback(3239) INFO Warp 4.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:14,284 geoprocessing.logger\_callback(3239) INFO Warp 6.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:20,068 geoprocessing.logger\_callback(3239) INFO Warp 7.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:25,875 geoprocessing.logger\_callback(3239) INFO Warp 8.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:36,357 geoprocessing.logger\_callback(3239) INFO Warp 10.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:45,500 geoprocessing.logger\_callback(3239) INFO Warp 12.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:31:54,600 geoprocessing.logger\_callback(3239) INFO Warp 14.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:04,021 geoprocessing.logger\_callback(3239) INFO Warp 16.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:13,380 geoprocessing.logger\_callback(3239) INFO Warp 18.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:22,724 geoprocessing.logger\_callback(3239) INFO Warp 20.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:31,948 geoprocessing.logger\_callback(3239) INFO Warp 22.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:41,398 geoprocessing.logger\_callback(3239) INFO Warp 24.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:32:50,750 geoprocessing.logger\_callback(3239) INFO Warp 26.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:00,039 geoprocessing.logger\_callback(3239) INFO Warp 28.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:09,158 geoprocessing.logger\_callback(3239) INFO Warp 30.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:18,278 geoprocessing.logger\_callback(3239) INFO Warp 32.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:27,530 geoprocessing.logger\_callback(3239) INFO Warp 34.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:36,712 geoprocessing.logger\_callback(3239) INFO Warp 36.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:45,988 geoprocessing.logger\_callback(3239) INFO Warp 38.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:33:55,240 geoprocessing.logger\_callback(3239) INFO Warp 40.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:00,518 geoprocessing.logger\_callback(3239) INFO Warp 41.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:10,108 geoprocessing.logger\_callback(3239) INFO Warp 43.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:19,111 geoprocessing.logger\_callback(3239) INFO Warp 45.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:28,440 geoprocessing.logger\_callback(3239) INFO Warp 47.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:37,364 geoprocessing.logger\_callback(3239) INFO Warp 49.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:46,787 geoprocessing.logger\_callback(3239) INFO Warp 51.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:34:56,039 geoprocessing.logger\_callback(3239) INFO Warp 53.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:05,209 geoprocessing.logger\_callback(3239) INFO Warp 55.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:14,230 geoprocessing.logger\_callback(3239) INFO Warp 57.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:23,418 geoprocessing.logger\_callback(3239) INFO Warp 59.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:32,769 geoprocessing.logger\_callback(3239) INFO Warp 61.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:41,922 geoprocessing.logger\_callback(3239) INFO Warp 63.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:35:50,929 geoprocessing.logger\_callback(3239) INFO Warp 65.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:00,043 geoprocessing.logger\_callback(3239) INFO Warp 67.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:09,090 geoprocessing.logger\_callback(3239) INFO Warp 69.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:18,206 geoprocessing.logger\_callback(3239) INFO Warp 71.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:27,266 geoprocessing.logger\_callback(3239) INFO Warp 73.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:36,527 geoprocessing.logger\_callback(3239) INFO Warp 75.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:45,609 geoprocessing.logger\_callback(3239) INFO Warp 77.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:36:54,646 geoprocessing.logger\_callback(3239) INFO Warp 79.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:03,715 geoprocessing.logger\_callback(3239) INFO Warp 81.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:13,306 geoprocessing.logger\_callback(3239) INFO Warp 83.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:22,941 geoprocessing.logger\_callback(3239) INFO Warp 85.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:32,530 geoprocessing.logger\_callback(3239) INFO Warp 87.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:41,312 geoprocessing.logger\_callback(3239) INFO Warp 89.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:49,675 geoprocessing.logger\_callback(3239) INFO Warp 91.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:37:58,039 geoprocessing.logger\_callback(3239) INFO Warp 93.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:38:06,442 geoprocessing.logger\_callback(3239) INFO Warp 95.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:38:14,792 geoprocessing.logger\_callback(3239) INFO Warp 97.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:38:23,249 geoprocessing.logger\_callback(3239) INFO Warp 99.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:38:27,427 geoprocessing.logger\_callback(3239) INFO Warp 100.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_lulc\_1.tif  
2020-04-07 16:38:27,793 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 1 of 2 aligned: aligned\_lulc\_1.tif  
2020-04-07 16:38:32,885 geoprocessing.logger\_callback(3239) INFO Warp 63.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_soils\_hydrological\_group\_1.tif  
2020-04-07 16:38:35,540 geoprocessing.logger\_callback(3239) INFO Warp 100.0% complete C:\Users\KBLANN\Documents\urban\_flood\_risk\_mitigation\_workspace\temp\_working\_dir\_not\_for\_humans\aligned\_soils\_hydrological\_group\_1.tif  
2020-04-07 16:38:36,012 geoprocessing.align\_and\_resize\_raster\_stack(752) INFO 2 of 2 aligned: aligned\_soils\_hydrological\_group\_1.tif  
2020-04-07 16:38:36,012 geoprocessing.align\_and\_resize\_raster\_stack(754) INFO aligned all 2 rasters.  
2020-04-07 16:38:36,078 geoprocessing.raster\_calculator(375) INFO starting stats\_worker  
2020-04-07 16:38:36,078 geoprocessing.raster\_calculator(381) INFO started stats\_worker \<Thread(Thread-2, started daemon 3040)\>  
2020-04-07 16:38:36,094 threading.run(870) DEBUG payload is None, terminating  
2020-04-07 16:38:36,094 geoprocessing.raster\_calculator(486) INFO Waiting for raster stats worker result.  
2020-04-07 16:38:36,094 threading.run(870) WARNING No valid pixels were received, sending None.  
2020-04-07 16:38:36,094 Task.add\_task(641) ERROR Something went wrong when adding task create cn raster (1), terminating taskgraph.  
Traceback (most recent call last):  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 816, in \_lu\_to\_cn\_op  
File “site-packages\scipy\sparse\_index.py”, line 35, in **getitem**  
File “site-packages\scipy\sparse\_index.py”, line 139, in \_validate\_indices  
File “site-packages\scipy\sparse\_index.py”, line 171, in \_asindices  
IndexError: index (128) out of range  
2020-04-07 16:38:36,094 model.\_logged\_target(1648) ERROR Exception while executing \<function execute at 0x0DF3A9C0\>  
Traceback (most recent call last):  
File “site-packages\natcap\invest\ui\model.py”, line 1645, in \_logged\_target  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 250, in execute  
File “site-packages\taskgraph\Task.py”, line 607, in add\_task  
File “site-packages\taskgraph\Task.py”, line 1071, in \_call  
File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster\_calculator  
File “site-packages\natcap\invest\urban\_flood\_risk\_mitigation.py”, line 816, in \_lu\_to\_cn\_op  
File “site-packages\scipy\sparse\_index.py”, line 35, in **getitem**  
File “site-packages\scipy\sparse\_index.py”, line 139, in \_validate\_indices  
File “site-packages\scipy\sparse\_index.py”, line 171, in \_asindices  
IndexError: index (128) out of range  
2020-04-07 16:38:36,094 model.\_logged\_target(1651) INFO Execution finished  
2020-04-07 16:38:36,094 utils.prepare\_workspace(121) INFO Elapsed time: 7m 51.420000000000016s

---

<div class="post-metadata">

**Author:** ![jdouglass](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/jdouglass/32/9_2.png) [@jdouglass](https://community.naturalcapitalalliance.org/u/jdouglass)\
**Post date:** [April 8, 2020, 9:25pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/8 "2020-04-08T21:25:01Z")

</div>

Hi @kblann, I think this is the same error as posted over in [Urban Flood Mitigation model run error](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-model-run-error/918/2), right? If so, let’s continue the conversation over there!

---

<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:** [June 26, 2020, 4:24pm UTC](https://community.naturalcapitalalliance.org/t/urban-flood-mitigation-error-valueerror-invalid-entry-in-choice-array/814/9 "2020-06-26T16:24:32Z")

</div>

Closed on June 26, 2020, 4:24pm UTC

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