SDR Model error - ufunc 'isfinite' not supported for the input types

I’m trying to run the SDR model and keep getting the error:
TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’

Initializing…
Showing messages with level INFO and higher
2019-11-04 10:55:11,895 utils.prepare_workspace(109) INFO Writing log messages to C:\Users\caity.brawn\Desktop\fowlder\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2019-11-04–10_55_11.txt
2019-11-04 10:55:11,897 model._logged_target(1633) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.sdr 3.7.0:
biophysical_table_path C:/Users/caity.brawn/Desktop/USLEcodes.csv
dem_path S:/Staff/Caity/Projects/InVEST_Data/Model Data 2/dtmfilll.tif
drainage_path
erodibility_path O:/InVEST/SDR Test/RSC7_Soil_Raster.tif
erosivity_path S:/Staff/Caity/Projects/InVEST_Data/Model Data 2/RA_R_Hist.tif
ic_0_param 0.5
k_param 2.0
lulc_path S:/Staff/Caity/Projects/InVEST_Data/Model Data 2/RA_LC_Intact.tif
n_workers -1
results_suffix test1
sdr_max 0.8
threshold_flow_accumulation 10000
watersheds_path S:/Staff/Caity/Projects/InVEST_Data/Model Data 2/Subcatchments.shp
workspace_dir C:\Users\caity.brawn\Desktop\fowlder

2019-11-04 10:55:33,944 Task._call(1068) INFO filter out incomplete divergent streams
2019-11-04 10:55:33,989 Task._call(1068) INFO 100.0% complete
2019-11-04 10:55:34,063 geoprocessing.raster_calculator(366) INFO starting stats_worker
2019-11-04 10:55:34,063 geoprocessing.raster_calculator(372) INFO started stats_worker <Thread(Thread-23, started daemon 22656)>
2019-11-04 10:55:34,072 geoprocessing.raster_calculator(477) INFO Waiting for raster stats worker result.
2019-11-04 10:55:34,072 threading.run(754) WARNING No valid pixels were received, sending None.
2019-11-04 10:55:34,075 Task.add_task(636) ERROR Something went wrong when adding task calculate RKLS (10), terminating taskgraph.
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 695, in _calculate_rkls
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 677, in rkls_function
File “C:\Python27\lib\site-packages\numpy\core\numeric.py”, line 2522, in isclose
TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’
2019-11-04 10:55:34,089 model._logged_target(1639) ERROR Exception while executing <function execute at 0x0F5B38F0>
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 320, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 695, in _calculate_rkls
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 677, in rkls_function
File “C:\Python27\lib\site-packages\numpy\core\numeric.py”, line 2522, in isclose
TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’
2019-11-04 10:55:34,096 model._logged_target(1642) INFO Execution finished
2019-11-04 10:55:34,104 utils.prepare_workspace(115) INFO Elapsed time: 22.21s
2019-11-04 10:55:34,108 execution.run(78) ERROR Target <function _logged_target at 0x0F5FA9B0> failed with exception
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 320, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1068, in _call
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 695, in _calculate_rkls
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\sdr.py”, line 677, in rkls_function
File “C:\Python27\lib\site-packages\numpy\core\numeric.py”, line 2522, in isclose
TypeError: ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’
2019-11-04 10:55:34,117 execution.run(83) INFO Execution finished

Hi @CaityBrawn, could you try this latest development build and see if we have already fixed this issue?

Here’s the download link: https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.7.0.post478%2Bhb364bc60ac3d/InVEST_3.7.0.post478%2Bhb364bc60ac3d_x86_Setup.exe

If the issue persists, could you send us your inputs so we can take a closer look?

Thanks,
James

Hi James,

I ran the model using the latest development build you shared and it has run! Although I haven’t verified the results yet.

Thanks for you help!
-Caity

OK! Great to hear that the model isn’t crashing with this latest development build. Keep us posted.