Crop yield module error: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

Hello, my crop production module operation is always wrong, but can not find the problem, the wrong screenshot is as follows, everyone has any good opinion

03/07/2023 15:14:57 natcap.invest.utils Level 100 Writing log messages to [D:\lunwenziliao\xiaolunwen\����\2000bean\InVEST-natcap.invest.crop_production_percentile-log-2023-03-07–15_14_57.txt]
03/07/2023 15:14:57 main Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.crop_production_percentile 3.12.1:
aggregate_polygon_path
landcover_raster_path D:\lunwenziliao\xiaolunwen\PLUSmodel\LUCC\2000lucc.tif
landcover_to_crop_table_path C:\Users\13598\Desktop\landcover_to_crop_table.csv
model_data_path D:\InVEST\CropProduction\model_data
n_workers -1
results_suffix 2000baen
workspace_dir D:\lunwenziliao\xiaolunwen\����\2000bean

03/07/2023 15:14:57 natcap.invest.crop_production_percentile INFO Processing crop rice
03/07/2023 15:14:57 natcap.invest.crop_production_percentile INFO Clipping global climate bin raster to landcover bounding box.
03/07/2023 15:14:57 natcap.invest.crop_production_percentile INFO Map yield_25th to climate bins.
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO starting stats_worker
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO started stats_worker <Thread(Thread-1 (stats_worker), started daemon 10020)>
03/07/2023 15:14:57 pygeoprocessing.geoprocessing ERROR exception encountered in raster_calculator
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “osgeo\gdal.py”, line 3743, in ReadAsArray
File “C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport_feature_.py”, line 142, in _import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “PyInstaller\loader\pyimod02_importers.py”, line 499, in exec_module
File “osgeo\gdal_array.py”, line 137, in
SystemError: _PyEval_EvalFrameDefault returned a result with an exception set
03/07/2023 15:14:57 pygeoprocessing.geoprocessing INFO Waiting for raster stats worker result.
03/07/2023 15:14:57 pygeoprocessing.geoprocessing_core WARNING No valid pixels were received, sending None.
03/07/2023 15:14:57 taskgraph.Task ERROR Something went wrong when adding task create_coarse_yield_percentile_rice_yield_25th (1), terminating taskgraph.
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task.py”, line 1093, in call
File “natcap\invest\utils.py”, line 955, in reclassify_raster
File “pygeoprocessing\geoprocessing.py”, line 1944, in reclassify_raster
File “pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “osgeo\gdal.py”, line 3743, in ReadAsArray
File "C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport_feature
.py", line 142, in _import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “PyInstaller\loader\pyimod02_importers.py”, line 499, in exec_module
File “osgeo\gdal_array.py”, line 137, in
SystemError: _PyEval_EvalFrameDefault returned a result with an exception set
03/07/2023 15:14:57 natcap.invest.utils ERROR Exception while executing natcap.invest.crop_production_percentile
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd5 in position 71: invalid continuation byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

SystemError: <class ‘UnicodeDecodeError’> returned a result with an exception set

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 72, in _log_gdal_errors
SystemError: returned a result with an exception set

The above exception was the direct cause of the following exception:

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\crop_production_percentile.py”, line 430, in execute
File “taskgraph\Task.py”, line 674, in add_task
File “taskgraph\Task.py”, line 1093, in call
File “natcap\invest\utils.py”, line 955, in reclassify_raster
File “pygeoprocessing\geoprocessing.py”, line 1944, in reclassify_raster
File “pygeoprocessing\geoprocessing.py”, line 415, in raster_calculator
File “osgeo\gdal.py”, line 3743, in ReadAsArray
File "C:\Users\13598\AppData\Local\Temp\embedded.tzlylaiq.zip\shibokensupport_feature
.py", line 142, in _import
File “”, line 1027, in _find_and_load
File “”, line 1006, in _find_and_load_unlocked
File “”, line 688, in _load_unlocked
File “PyInstaller\loader\pyimod02_importers.py”, line 499, in exec_module
File “osgeo\gdal_array.py”, line 137, in
SystemError: _PyEval_EvalFrameDefault returned a result with an exception set
03/07/2023 15:14:57 natcap.invest.utils INFO Elapsed time: 0.11s
03/07/2023 15:14:57 natcap.invest.utils INFO Execution finished

Hi @summon,

Thanks for posting and pasting your logfile. Could you also upload / attach your logfile? It’s easier for us to review it for errors with the actual file.

But, it looks like you might be having the same issue as this post: 'utf-8' codec can't decode byte 0xd5 in position 71 - #3 by jujeonghoo.

Could you try the steps outlined in that post?

Doug

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