SWY model value error?


I’m trying to run SWY model, but it seems like something wrong. From the report it seem like "value " was the main problem, but i’m not really sure what does it mean??


04/22/2023 18:08:16 natcap.invest.utils Level 100 Writing log messages to [C:\SWY\InVEST-natcap.invest.seasonal_water_yield.seasonal_water_yield-log-2023-04-22–18_08_16.txt]
04/22/2023 18:08:16 main Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.seasonal_water_yield.seasonal_water_yield 3.12.0:
alpha_m 1/2
aoi_path C:\shp�ϸ�\�פ����\���̷ˬy��.dbf
beta_i 1
biophysical_table_path C:\Users\jenni\Desktop\SWYtest\swy_biotable2.csv
dem_raster_path C:\shp�ϸ�\INVEST\demGP.tif
et0_dir C:\Users\jenni\Desktop\SWYtest\ETO Directory
gamma 1
lulc_raster_path C:\shp�ϸ�\INVEST\LULC_INVEST.tif
monthly_alpha False
n_workers -1
precip_dir C:\Users\jenni\Desktop\SWYtest\Precipitation Directory
rain_events_table_path C:\Users\jenni\Desktop\SWYtest\swy_Rain Events Table.csv
results_suffix 5
soil_group_path C:\shp�ϸ�\INVEST\HSGGP_NEW.tif
threshold_flow_accumulation 1000
user_defined_climate_zones False
user_defined_local_recharge False
workspace_dir C:\SWY

04/22/2023 18:08:16 natcap.invest.seasonal_water_yield.seasonal_water_yield INFO prepare and test inputs for common errors
04/22/2023 18:08:16 natcap.invest.utils WARNING Empty or NaN values were found in the table: C:\Users\jenni\Desktop\SWYtest\swy_biotable2.csv.
04/22/2023 18:08:16 natcap.invest.utils WARNING Encountered an entirely blank row on line(s) [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]. Dropping rows from table.
04/22/2023 18:08:16 natcap.invest.seasonal_water_yield.seasonal_water_yield INFO Building file registry
04/22/2023 18:08:16 natcap.invest.seasonal_water_yield.seasonal_water_yield INFO Checking that the AOI is not the output aggregate vector
04/22/2023 18:08:16 natcap.invest.seasonal_water_yield.seasonal_water_yield INFO Aligning and clipping dataset list
04/22/2023 18:08:16 natcap.invest.utils ERROR Exception while executing natcap.invest.seasonal_water_yield.seasonal_water_yield
Traceback (most recent call last):
File “natcap\invest\utils.py”, line 164, in prepare_workspace
File “invest\cli.py”, line 486, in main
File “natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 408, in execute
File “natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 532, in _execute
ValueError: Ambiguous set of files found for month 1: [‘C:\Users\jenni\Desktop\SWYtest\ETO Directory\eto_1.tfw’, ‘C:\Users\jenni\Desktop\SWYtest\ETO Directory\eto_1.tif’]
04/22/2023 18:08:16 natcap.invest.utils INFO Elapsed time: 0.06s
04/22/2023 18:08:16 natcap.invest.utils INFO Execution finished


InVEST-natcap.invest.seasonal_water_yield.seasonal_water_yield-log-2023-04-22–18_08_16.txt (3.3 KB)

Thanks for posting your log file @JENN. The error message is not very clear, but it says this:

ValueError: Ambiguous set of files found for month 1: [‘C:\Users\jenni\Desktop\SWYtest\ETO Directory\eto_1.tfw’, ‘C:\Users\jenni\Desktop\SWYtest\ETO Directory\eto_1.tif’]

As the User Guide says, only TIFF files (.tif) may be in the monthly ETo and precipitation folders. It looks like you have “.tfw” files in that folder as well, which the model cannot handle. All you need to do is move only the .tif files into their own folder, then use that folder as input to the model. That should fix this error.

~ Stacie

1 Like

@swolny Thank you for reply. It gets work after I checked my file and remove the file which is not TIFF.
But after that, there is other problems appear. It shows “taskgraph.Task ERROR Something went wrong when adding task fill dem pits (1), terminating taskgraph.” when I run again. I guess it is related with the input data of DEM, so I’ve tried to make sure the data had the same grid size as the other and recreated the DEM data, but it still ERROR. So i’d like to make sure if there are other attempts to fix it?
Thank you again for your help and also welcome to other INVEST friends on this community to join the discussion!


InVEST-natcap.invest.seasonal_water_yield.seasonal_water_yield-log-2023-05-07–16_20_04.txt (20.3 KB)

Hi @JENN -

If you search this forum for that error, you’ll find several postings that may be related to this latest error. In particular, please check out this recent post and see if it helps.

~ Stacie

Yes, and to follow up with Stacie’s suggestion of following that posts workaround:

I wanted to update this thread as well about a workaround: Installing InVEST for all users during the installation process will bypass this issue.

Could you let us know if that does NOT work for you as a solution? Thanks!


@swolny @dcdenu4 Thank you for your replies. I’ve search my operation problems in this community, and now trying to fix DEM with reproject coordinate system, check nodata and fill the sinks first.
Perhaps these steps will solve my problem.

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