KeyError in running NDR model?

[InVEST-Nutrient-Delivery-Ratio-Model-(NDR)-log-2021-10-09--12_41_38.txt|attachment](upload://hOdlJYbWDmiV8siVRJ4D1RQ5MSm.txt) (8.5 KB)

Hi @wubneh , thanks for posting. Your logfile attachment did not seem to come through. Could you try again please?

Also, you might find useful solutions in some other threads on this forum that deal with KeyErrors in NDR:
https://community.naturalcapitalproject.org/search?q=KeyError%20NDR

Dear Dave,
Attached, please find the log file. I will try to read the discussion via the link you sent.
Kind regards,

Wubneh Belete Abebe, MSc, BSc

PhD Candidate - Water Resources Engineering and Management, Bahir Dar University

Former, DGM and head of land use planning and Environmental impact study Core work process
Amhara Design and Supervision Works Enterprise
P.O.Box 1921, Kebele 011, Bahir dar, Ethiopia
Tel 00251 935 982616, 00251 985 246096
Fax 00251 58 218 0550/560

InVEST-Nutrient-Delivery-Ratio-Model-(NDR)-log-2021-10-11–11_18_33.txt (8.55 KB)

Hi @wubneh ,

The log file reads, “KeyError: 0”. This likely indicates that you have a value in the LULC raster of 0 that is not represented in the biophysical table. Please check and adjust that input.

-Jesse

Agreed. Also if you try updating to a more recent version of invest, I believe you might get a more helpful error message in this instance. InVEST | Natural Capital Project

1 Like

Thank you for your response. Yeah, I got this error and corrected and the KeyError comes again with another number i.e. 10 and on another step 7. I still need your help.

Hi @wubneh,

Every value in the LULC needs to have a corresponding value in the biophysical table. You need to either include ALL of the values mentioned by such errors in your biophysical table or to remove them from the LULC. Does that make sense?

-Jesse

Thank you Jessie. I have solved the error.

Wubneh Belete Abebe, MSc, BSc

PhD Candidate - Water Resources Engineering and Management, Bahir Dar University

Former, DGM and head of land use planning and Environmental impact study Core work process
Amhara Design and Supervision Works Enterprise
P.O.Box 1921, Kebele 011, Bahir dar, Ethiopia
Tel 00251 935 982616, 00251 985 246096
Fax 00251 58 218 0550/560

1 Like