# SDR model KEY ERROR: nan

**URL:** <https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370>\
**Category:** Software Support\
**Tags:** sdr\
**Created:** [September 30, 2020, 7:34am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370 "2020-09-30T07:34:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisagalgani](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/luisagalgani/32/777_2.png) [@luisagalgani](https://community.naturalcapitalalliance.org/u/luisagalgani)\
**Post date:** [September 30, 2020, 7:34am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/1 "2020-09-30T07:34:34Z")

</div>

Hello,  
while running the SDR model I get a key error “nan”. I am not sure why, seems “not an actual number” so I guess it deals with the LULC raster, but I think all classes are actual numbers…any idea? I attach the log. Thanks for your support ![InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-09-29--18_37_48.txt|attachment](https://canada1.discourse-cdn.com/flex031/uploads/naturalcapitalproject/original/1X/dde3be96d20d57ea5a3844604ab39ba147e3aac5.txt) (142.7 KB)  
have a nice day,  
Luisa

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [September 30, 2020, 11:07am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/2 "2020-09-30T11:07:02Z")

</div>

Hi @luisagalgani,

Could you try attaching the log again? It doesn’t appear to be a downloadable link.

Thanks!

Doug

---

<div class="post-metadata">

**Author:** ![luisagalgani](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/luisagalgani/32/777_2.png) [@luisagalgani](https://community.naturalcapitalalliance.org/u/luisagalgani)\
**Post date:** [September 30, 2020, 11:23am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/3 "2020-09-30T11:23:04Z")

</div>

[InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2020-09-28–16\_29\_07.txt](https://community.naturalcapitalalliance.org/uploads/short-url/paAmKQ1FrnbT274kAAYypMmsb5E.txt) (142.8 KB)  
Thank you Doug. Does it work now?

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [September 30, 2020, 6:24pm UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/4 "2020-09-30T18:24:30Z")

</div>

Hi @luisagalgani,

Thanks. Could you check what the nodata value of the LULC raster is? If it’s not defined could you define it? If the nodata value seems fine for the LULC raster could you share your biophysical table and LULC raster?

Thanks!

Doug

---

<div class="post-metadata">

**Author:** ![luisagalgani](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/luisagalgani/32/777_2.png) [@luisagalgani](https://community.naturalcapitalalliance.org/u/luisagalgani)\
**Post date:** [October 1, 2020, 2:23pm UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/5 "2020-10-01T14:23:06Z")

</div>

Thank you so much Doug. I have modified the raster, filling nodata values with 0. However, now I obtain a different error.  
“ValueError: The following 1 raster values [2241.] from “C:/Users/luisa/Documents/InVEST models/sdr\_workspace\_DEM10mCLC2000\intermediate\_outputs\churn\_dir\_not\_for\_humans\aligned\_lulc.tif” do not have corresponding entries in the `value_map`: {111: 0.078, 112: 0.078, 121: 0.078, 131: 0.078, 133: 0.078, 142: 0.078, 221: 0.3454, 222: 0.2188, 231: 0.0988, 242: 0.1478, 243: 0.1245, 3112: 0.0013, 3113: 0.0013, 3114: 0.0013, 3115: 0.0013, 3116: 0.0013, 3117: 0.0013, 3122: 0.0013, 3123: 0.0013, 3124: 0.0013, 31313: 0.0013, 31315: 0.0013, 31316: 0.0013, 31322: 0.0013, 31323: 0.0013, 31324: 0.0013, 3211: 0.0416, 3212: 0.0416, 322: 0.042, 324: 0.0242, 331: 0.078, 332: 0.0, 333: 0.2509, 335: 0.0, 511: 0.0, 512: 0.0, 523: 0.0, 2111: 0.1478}  
2020-10-01 10:22:33,115 execution.run(83) INFO Execution finished”. I attach the biophysical table. The raster gives me errors when trying to upload. Maybe it is too big. And it won’t allow zip uploads. How may I share it?  
Thanks for your help!  
Luisa[SDR\_PiaveCLC2000.csv](https://community.naturalcapitalalliance.org/uploads/short-url/g6AP9RA6V6E2i2tihcOWQL1InTK.csv) (2.8 KB)

---

<div class="post-metadata">

**Author:** ![dcdenu4](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/dcdenu4/32/544_2.png) [@dcdenu4](https://community.naturalcapitalalliance.org/u/dcdenu4)\
**Post date:** [October 1, 2020, 2:29pm UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/6 "2020-10-01T14:29:40Z")

</div>

Hey @luisagalgani,

This error indicates that you have a value in the LULC raster of `2241` that is not represented in the biophysical table. Could you open the LULC raster in a GIS viewer and see if you can confirm that there is a `2241` value there? If so, you’ll need to add an entry for it in the biophysical table.

If not you could share that LULC raster via google drive link, or dropbox, or another cloud sharing service. You can either post the shared link here, direct message it to me, or email it to me at `ddenu@stanford.edu`. Hope this helps!

Doug

---

<div class="post-metadata">

**Author:** ![luisagalgani](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.naturalcapitalalliance.org/luisagalgani/32/777_2.png) [@luisagalgani](https://community.naturalcapitalalliance.org/u/luisagalgani)\
**Post date:** [October 2, 2020, 8:09am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/7 "2020-10-02T08:09:54Z")

</div>

Thank you so much! I have been able to run it finally! Thanks again!! Have a nice day!  
Luisa

---

<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:** [October 9, 2020, 8:10am UTC](https://community.naturalcapitalalliance.org/t/sdr-model-key-error-nan/1370/8 "2020-10-09T08:10:00Z")

</div>

Closed on October 9, 2020, 8:10am UTC

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