Runtime Error - Visitation and Tourism Model

Dear users and developers,

I’m running the inVEST Visitation: Recreation and Tourism model and somehow is running into a Runtime Error (picture attached) I used 2 predictors in my predictor table; one is a polygon shapefile and another one is raster data. The results that I get did not include the regression_coefficients information, and changing the predictors also did not seem to change anything in the output table. Any thoughts on what I could do?

Any help is highly appreciated! Thank you.

Thanks for posting. Could you upload the entire logfile (.txt file in output workspace) from this run? If that doesn’t reveal the issue I may also ask you to share the input data that would let me reproduce this error.

Thank you!

Hi Dave thanks so much for your reply!

Here’s the log file for your reference:

Initializing…
Showing messages with level INFO and higher
2019-06-24 08:57:39,663 utils.prepare_workspace(109) INFO Writing log messages to H:\tests_rec\InVEST-Recreation-Model-log-2019-06-24–08_57_39.txt
2019-06-24 08:57:39,663 model._logged_target(1633) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.recreation.recmodel_client 3.7.0:
aoi_path H:/Invest_recreation/Regions and Municipalities/Maule_M.shp
compute_regression True
end_year 2017
grid_aoi False
n_workers -1
predictor_table_path H:/tests_rec/try_Maule .csv
results_suffix 7
scenario_predictor_table_path
start_year 2016
workspace_dir H:\tests_rec

2019-06-24 08:57:42,270 recmodel_client._retrieve_photo_user_days(327) INFO Contacting server, please wait.
2019-06-24 08:57:42,661 recmodel_client._retrieve_photo_user_days(330) INFO Server online, version: 3.3.2:./recserver_cache_2017/76e890d2cf86640e_fast_hash.pickle
2019-06-24 08:57:42,802 recmodel_client._retrieve_photo_user_days(338) INFO Server supports year queries between 2005 and 2017
2019-06-24 08:57:42,802 recmodel_client._retrieve_photo_user_days(357) INFO archiving H:\tests_rec\intermediate\aoi_7.prj
2019-06-24 08:57:42,816 recmodel_client._retrieve_photo_user_days(357) INFO archiving H:\tests_rec\intermediate\aoi_7.shp
2019-06-24 08:57:42,957 recmodel_client._retrieve_photo_user_days(357) INFO archiving H:\tests_rec\intermediate\aoi_7.shx
2019-06-24 08:57:42,957 recmodel_client._retrieve_photo_user_days(357) INFO archiving H:\tests_rec\intermediate\aoi_7.dbf
2019-06-24 08:57:43,036 recmodel_client._retrieve_photo_user_days(365) INFO Please wait for server to calculate PUD…
2019-06-24 08:57:56,230 recmodel_client._retrieve_photo_user_days(373) INFO received result, took 13.195000 seconds, workspace_id: 55364d63-6b3a-4e5a-9775-0c7e83888b8a
2019-06-24 08:57:56,936 recmodel_client._retrieve_photo_user_days(386) INFO connection release
2019-06-24 08:57:56,967 Task.add_task(636) ERROR Something went wrong when adding task photo-user-day-calculation (1), terminating taskgraph.
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1082, in _call
RuntimeError: In Task: photo-user-day-calculation (1)
Missing expected target path results.
Expected: [u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\monthly_table_7.csv’, u’h:\\tests_rec\\pud_results_7.shp’]
Observed: set([u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\pud_results_7.shp’])

2019-06-24 08:57:56,967 model._logged_target(1639) ERROR Exception while executing <function execute at 0x0F905470>
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\recreation\recmodel_client.py”, line 226, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1082, in _call
RuntimeError: In Task: photo-user-day-calculation (1)
Missing expected target path results.
Expected: [u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\monthly_table_7.csv’, u’h:\\tests_rec\\pud_results_7.shp’]
Observed: set([u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\pud_results_7.shp’])

2019-06-24 08:57:56,967 model._logged_target(1642) INFO Execution finished
2019-06-24 08:57:56,982 utils.prepare_workspace(115) INFO Elapsed time: 17.32s
2019-06-24 08:57:56,982 execution.run(78) ERROR Target <function _logged_target at 0x0F917BF0> failed with exception
Traceback (most recent call last):
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\execution.py”, line 68, in run
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\ui\model.py”, line 1636, in _logged_target
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\natcap\invest\recreation\recmodel_client.py”, line 226, in execute
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 602, in add_task
File “Z:\opt\atlassian\pipelines\agent\build\env\lib\site-packages\taskgraph\Task.py”, line 1082, in _call
RuntimeError: In Task: photo-user-day-calculation (1)
Missing expected target path results.
Expected: [u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\monthly_table_7.csv’, u’h:\\tests_rec\\pud_results_7.shp’]
Observed: set([u’h:\\tests_rec\\intermediate\\server_version_7.pickle’, u’h:\\tests_rec\\intermediate\\pud_7.zip’, u’h:\\tests_rec\\intermediate\\aoi_7.zip’, u’h:\\tests_rec\\pud_results_7.shp’])

2019-06-24 08:57:56,997 execution.run(83) INFO Execution finished

If that does not work I’ll also be happy to share my input data.

Thanks!

Best,
Liyana

Thank you, this was helpful. I was a able to reproduce this error and it appears to be a bug in the handling of the results_suffix parameter. We’ll get this fixed for the next release of InVEST. In the meantime you will need to avoid using the results_suffix. You could change the workspace to achieve a similar result. If the workspace folder does not already exist, the model will create it for you.

Hi Dave,

thanks so much! That was really helpful. I skipped the result_suffix parameter and created a different workspace and managed to run the program successfully. However, another snag: I compared the PUD results across different trials with different predictors, and the value of PUD for each remains exactly the same. For example, for one trial I used only one predictor, and another trial I used 4 different predictors. Both ran successfully, but when I opened the PUD result the numbers stay the same. I appreciate any input!

Liyana

Hi Liyana,

This is an expected outcome. The PUD values in pud_results.shp and monthly_table.csv are not a function of the predictor datasets, they are simply a count per polygon based on the database of geotagged photographs that have been shared on Flickr over the years you select. You need not provide any predictor data to get these results.

The coefficient values in regression_coefficients.txt should change with different sets of predictors. These coefficients are a way to measure the effect of a predictor on the existing visitation patterns. If you wish to see how visitation patterns might change under a scenario, first you’ll need to compute a regression that models the existing relationship between the predictors and the PUD patterns, and then you could use that regression model to estimate changes in the PUD patterns given changes in the predictor datasets. That would require evaluating the regression results in regression_coefficients.txt and then once happy with them applying the Scenario Predictor Table option.

Hi Dave,

everything makes sense now! I realized there is a difference between the regression coefficients but the PUD and monthly table stay the same on all trials. Thanks for the clarification!

Liyana

1 Like