Error RANGELAND PRODUCTION MODEL RPM


I try to run model with my data, and got error.
need some help, please

Hello Lagh,
could you please attach the full output log text file from the failed run of the model? that will help me track down what has happened. I am certain it’s an issue with your inputs but I am not sure yet which input may be the problem.

3 Likes

Initializing…
Showing messages with level INFO and higher
2022-10-03 16:50:01,233 utils.prepare_workspace(123) INFO Writing log messages to C:/Users/Administrateur/Desktop/Nouveau dossier\Rangeland-Production-Model-log-2022-10-03–16_50_01.txt
2022-10-03 16:50:01,233 model._logged_target(1635) Level 100 Starting model with parameters:
Arguments for InVEST rangeland_production.forage 0.2.1:
animal_grazing_areas_path C:/Users/Administrateur/Desktop/parcours/Grazingarea/Export_Output.dbf
animal_trait_path C:/Users/Administrateur/Desktop/parcours/animale parametre table.csv
aoi_path C:/Users/ADMINI~1/AppData/Local/Temp/Rar$DRa5840.43740/limite BV sebou/Limite_du_bassin_de_sebou.dbf
bulk_density_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/Densité apparente.tif
clay_proportion_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/Argile.tif
initial_conditions_dir
management_threshold 50
max_temp_dir C:\Users\Administrateur\Desktop\parcours\max_température_mensuelle_sebou
min_temp_dir C:\Users\Administrateur\Desktop\parcours\min_temp_mensuelle_sebou
n_months 12
n_workers -1
pft_initial_table C:/Users/Administrateur/Desktop/parcours/pft_initial_table (1).csv
ph_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/ph.tif
precip_dir C:\Users\Administrateur\Desktop\parcours\précipétation_2020_mensuelles sebou
proportion_legume_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/légume.tif
results_suffix
sand_proportion_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/sable.tif
save_sv_rasters False
silt_proportion_path C:/Users/Administrateur/Desktop/parcours/propriétés du sol/limon.tif
site_initial_table C:/Users/Administrateur/Desktop/parcours/site_initial_table.csv
site_param_spatial_index_path C:/Users/Administrateur/Desktop/parcours/site spatial/Int_tif11.tif
site_param_table C:/Users/Administrateur/Desktop/parcours/site_parameters (4).csv
starting_month 1
starting_year 2020
veg_spatial_composition_path_pattern C:\Users\Administrateur\Desktop\parcours"".tif
veg_trait_path C:/Users/Administrateur/Desktop/parcours/pft_trait (1).csv
workspace_dir C:/Users/Administrateur/Desktop/Nouveau dossier

2022-10-03 16:50:01,249 forage.execute(617) INFO model execute: {‘workspace_dir’: ‘C:/Users/Administrateur/Desktop/Nouveau dossier’, ‘results_suffix’: ‘’, ‘n_months’: ‘12’, ‘starting_year’: ‘2020’, ‘starting_month’: ‘1’, ‘aoi_path’: ‘C:/Users/ADMINI~1/AppData/Local/Temp/Rar$DRa5840.43740/limite BV sebou/Limite_du_bassin_de_sebou.dbf’, ‘management_threshold’: ‘50’, ‘proportion_legume_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/légume.tif’, ‘clay_proportion_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/Argile.tif’, ‘silt_proportion_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/limon.tif’, ‘sand_proportion_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/sable.tif’, ‘bulk_density_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/Densité apparente.tif’, ‘ph_path’: ‘C:/Users/Administrateur/Desktop/parcours/propriétés du sol/ph.tif’, ‘precip_dir’: ‘C:\Users\Administrateur\Desktop\parcours\précipétation_2020_mensuelles sebou’, ‘min_temp_dir’: ‘C:\Users\Administrateur\Desktop\parcours\min_temp_mensuelle_sebou’, ‘max_temp_dir’: ‘C:\Users\Administrateur\Desktop\parcours\max_température_mensuelle_sebou’, ‘site_param_spatial_index_path’: ‘C:/Users/Administrateur/Desktop/parcours/site spatial/Int_tif11.tif’, ‘veg_spatial_composition_path_pattern’: ‘C:\Users\Administrateur\Desktop\parcours\“”.tif’, ‘animal_grazing_areas_path’: ‘C:/Users/Administrateur/Desktop/parcours/Grazingarea/Export_Output.dbf’, ‘site_param_table’: ‘C:/Users/Administrateur/Desktop/parcours/site_parameters (4).csv’, ‘veg_trait_path’: ‘C:/Users/Administrateur/Desktop/parcours/pft_trait (1).csv’, ‘animal_trait_path’: ‘C:/Users/Administrateur/Desktop/parcours/animale parametre table.csv’, ‘initial_conditions_dir’: ‘’, ‘site_initial_table’: ‘C:/Users/Administrateur/Desktop/parcours/site_initial_table.csv’, ‘pft_initial_table’: ‘C:/Users/Administrateur/Desktop/parcours/pft_initial_table (1).csv’, ‘save_sv_rasters’: False, ‘n_workers’: ‘-1’}
2022-10-03 16:50:01,378 model._logged_target(1641) ERROR Exception while executing <function execute at 0x00000000106BEA68>
Traceback (most recent call last):
File “src\rangeland_production\ui\model.py”, line 1638, in _logged_target
File “src\rangeland_production\forage.py”, line 772, in execute
TypeError: sequence item 0: expected str instance, numpy.uint8 found
2022-10-03 16:50:01,379 model._logged_target(1644) INFO Execution finished
2022-10-03 16:50:01,379 utils.prepare_workspace(129) INFO Elapsed time: 0.15s
2022-10-03 16:50:01,380 execution.run(78) ERROR Target <function InVESTModel.execute_model.._logged_target at 0x0000000010871678> failed with exception
Traceback (most recent call last):
File “src\rangeland_production\ui\execution.py”, line 68, in run
File “src\rangeland_production\ui\model.py”, line 1638, in _logged_target
File “src\rangeland_production\forage.py”, line 772, in execute
TypeError: sequence item 0: expected str instance, numpy.uint8 found
2022-10-03 16:50:01,381 execution.run(83) INFO Execution finished

Hello @Lagh ,
It looks like you may be missing some required entries in the site parameter table. It is required that for every integer value in the site parameter spatial index (your file “Int_tif11.tif”), there should be a corresponding row in the site parameter table (your table “site_parameters (4).csv”). The two data sources are linked by the “site” column in the site parameter table. So, for example, if your site parameter spatial index contains some pixels of value=4, there must be a row of parameters in the site parameter table where “site”=4.

If you check this, and it appears that your data meet the required condition, please check that the NoData value in your site spatial index raster is properly defined.

1 Like