Sdr execution issue

Dear, when I want to execute results of SDR then this error has occurred. kindly help me to sort out this problem.
Initializing…
Showing messages with level INFO and higher
05/23/2019 19:13:11 natcap.invest.utils INFO Writing log messages to C:\Users\Hashim\Desktop\new\thar final collection\results\InVEST-Sediment-Delivery-Ratio-Model-(SDR)-log-2019-05-23–19_13_11.txt
05/23/2019 19:13:11 natcap.invest.ui.usage ERROR Error when transforming coordinates: local variable ‘spatial_ref’ referenced before assignment
Traceback (most recent call last):
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\usage.py”, line 176, in _merge_local_bounding_boxes
UnboundLocalError: local variable ‘spatial_ref’ referenced before assignment
05/23/2019 19:13:11 natcap.invest.ui.model Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.sdr 3.4.4:
biophysical_table_path C:/Users/Hashim/Desktop/new/biophysical_thar.xlsx
dem_path C:/Users/Hashim/Desktop/final projected/dem/dem11.tif
drainage_path
erodibility_path C:/Users/Hashim/Desktop/new/thar final collection/k_factor/thar_PolygonToRaster1.tif
erosivity_path C:/Users/Hashim/Desktop/new/thar final collection/k_factor/thar_PolygonToRaster1.tif
ic_0_param .8
k_param .5
lulc_path C:/Users/Hashim/Desktop/final projected/land use land cover/expolyfinal_PolygonToRaster22.tif
results_suffix 1
sdr_max 0.8
threshold_flow_accumulation 13
watersheds_path C:/Users/Hashim/Desktop/new/thar final collection/dem/Export_Output_5.shp
workspace_dir C:\Users\Hashim\Desktop\new\thar final collection\results

05/23/2019 19:13:11 natcap.invest.ui.model ERROR Exception while executing <function execute at 0x10BFEAF0>
Traceback (most recent call last):
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py”, line 1505, in _logged_target
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\sdr.py”, line 117, in execute
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\utils.py”, line 448, in build_lookup_from_csv
Error: line contains NULL byte
05/23/2019 19:13:11 natcap.invest.ui.usage._log_model WARNING an exception encountered when logging AttributeError("‘NoneType’ object has no attribute ‘ExportToWkt’",)
05/23/2019 19:13:11 natcap.invest.ui.model INFO Execution finished
05/23/2019 19:13:11 natcap.invest.utils INFO Elapsed time: 0.21s
05/23/2019 19:13:11 natcap.invest.ui.execution ERROR Target <function _logged_target at 0x02901130> failed with exception
Traceback (most recent call last):
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py”, line 1505, in _logged_target
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\sdr.py”, line 117, in execute
File “c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\utils.py”, line 448, in build_lookup_from_csv
Error: line contains NULL byte
05/23/2019 19:13:11 natcap.invest.ui.execution INFO Execution finished

Hi @11niazikhan -

It looks like you are using an Excel spreadsheet (.xlsx) for the biophysical table, but the model requires a CSV (comma-separated value) table. Try saving your biophysical table to CSV and try again. Note that the User Guide has a Data Needs section that details the requirements of each input, such as table format.

Also, you are running a somewhat old version of the model, so I would recommend using the latest (version 3.7.0), which has many bug fixes and we are actively supporting.

~ Stacie

Thank you so much i try as per instruction.

Brother, i’ve change Biophysical table format xlsx to csv but also error occur . can you further guide me.Regards

Hi @11niazikhan -

I suspect that there is something about the format of the .csv that is causing the problem. Assuming that you do actually have the required “usle_c” field in the table, look at the table in a text editor (not Excel) and make sure that it is being saved with the values separated by commas (not semicolons or any other character.) Also make sure that there is not a blank line at the bottom of the file, sometimes that causes problems (but maybe this has been fixed in the latest version?)

It is helpful if you post the whole log file (.txt) that the model produces, it gives us extra information that often helps us understand what’s happening. Thanks!

~ Stacie

Thanks, @swolny I try again as your instruction.

Hi @swolny after changing the values in usle_c then this error has occurred, kindly, gave me a solution how I can manage this.Regards

Hi @11niazikhan -

It would be really helpful if you’d post the whole log file - in this case there might be more useful information earlier in the text.

The error “The rasters’ and vectors’ intersection is empty” often means that your input layers don’t all have exactly the same projected coordinate system, so they’re not lining up correctly. That’s the first thing to check, and reproject any that aren’t exactly the same. Also look for watershed polygons that are outside the boundary of the other (raster) input layers, and remove them if they exist, or extend the rasters to cover them.

~ Stacie

Hey, 11niazikhan!

have you tried changing your PC configurations? you Have to set the decimal places to “.” instead of “,”. Otherwise the model won’t run.

Victor