Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error when running with sharrow on Development branch. #755

Closed
stefancoe opened this issue Oct 12, 2023 · 6 comments
Closed

Assertion error when running with sharrow on Development branch. #755

stefancoe opened this issue Oct 12, 2023 · 6 comments
Labels
Bug Something isn't working/bug f

Comments

@stefancoe
Copy link
Contributor

Describe the bug
Code crashes on line 29 in land_use.py: assert df.index[0]==0

To Reproduce
Steps to reproduce the behavior:

  1. @jpn-- You should be able to reproduce this with the data I shared with you in August. I have included the log file.

activitysim.log

@stefancoe stefancoe added the Bug Something isn't working/bug f label Oct 12, 2023
@stefancoe
Copy link
Contributor Author

@jpn-- testing the generic_whale branch, this is the commit that casues the issue:
camsys@8435976

Any suggestions?

@jpn--
Copy link
Member

jpn-- commented Oct 24, 2023

A (partial) suggestion, to get code at least started running:

  1. Add recode_pipeline_columns: true to settings.yaml in configs_sh_compile and configs_sh for your model. The default setting for this was moved from true to false to more widely support backwards compatibility, but having a zero-based index on the land use table is required for sharrow compatibility.
  2. Run from the code in PR Fix memory usage #751 , which now includes a fix for the next error that this will trigger in your model, further down the line.

In my testing, you'll still end up with a crash later on in the model, I am working on fixing that as well.

@stefancoe
Copy link
Contributor Author

Thanks @jpn-- ! Are you getting the new crash in non_mandatory_tour_frequency?

@jpn--
Copy link
Member

jpn-- commented Oct 25, 2023

No, I am presently getting up to this error in non_mandatory_tour_destination:

[00:55.35] ERROR: ===== ERROR IN non_mandatory_tour_destination =====
[00:55.35] ERROR: Boolean array size 4796 is used to index array with shape (2398, 7).
Traceback (most recent call last):
  File "./activitysim/activitysim/core/workflow/steps.py", line 46, in wrapper
    return func(*args, **kwargs)
  File "./activitysim/activitysim/abm/models/non_mandatory_destination.py", line 75, in non_mandatory_tour_destination
    choices_df, save_sample_df = tour_destination.run_tour_destination(
  File "./activitysim/activitysim/abm/models/util/tour_destination.py", line 833, in run_tour_destination
    location_sample_df = run_destination_sample(
  File "./activitysim/activitysim/abm/models/util/tour_destination.py", line 564, in run_destination_sample
    choices = destination_presample(
  File "./activitysim/activitysim/abm/models/util/tour_destination.py", line 492, in destination_presample
    taz_sample = _destination_sample(
  File "./activitysim/activitysim/abm/models/util/tour_destination.py", line 109, in _destination_sample
    choices = interaction_sample(
  File "./activitysim/activitysim/core/interaction_sample.py", line 594, in interaction_sample
    choices = _interaction_sample(
  File "./activitysim/activitysim/core/interaction_sample.py", line 289, in _interaction_sample
    ) = interaction_simulate.eval_interaction_utilities(
  File "./activitysim/activitysim/core/interaction_simulate.py", line 418, in eval_interaction_utilities
    sh_utility_fat = sh_utility_fat[trace_rows, :]
...

@stefancoe
Copy link
Contributor Author

Thanks. I am getting a similar error, but in non_mandatory_tour_frequency:

'''
24/10/2023 12:07:08 - ERROR - root - ===== ERROR IN non_mandatory_tour_frequency =====
24/10/2023 12:07:08 - ERROR - root - Boolean array size 1728 is used to index array with shape (96, 210).
Traceback (most recent call last):
File "e:\asim_testing\asim_fix_mem_use\activitysim\activitysim\core\workflow\steps.py", line 46, in wrapper
return func(*args, **kwargs)
File "e:\asim_testing\asim_fix_mem_use\activitysim\activitysim\abm\models\non_mandatory_tour_frequency.py", line 251, in non_mandatory_tour_frequency
choices = interaction_simulate(
File "e:\asim_testing\asim_fix_mem_use\activitysim\activitysim\core\interaction_simulate.py", line 949, in interaction_simulate
choices = _interaction_simulate(
File "e:\asim_testing\asim_fix_mem_use\activitysim\activitysim\core\interaction_simulate.py", line 772, in _interaction_simulate
interaction_utilities, trace_eval_results = eval_interaction_utilities(
File "e:\asim_testing\asim_fix_mem_use\activitysim\activitysim\core\interaction_simulate.py", line 415, in eval_interaction_utilities
sh_utility_fat = sh_utility_fat[trace_rows, :]
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\dataarray.py", line 823, in getitem
return self.isel(indexers=self._item_key_to_dict(key))
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\dataarray.py", line 1421, in isel
variable = self._variable.isel(indexers, missing_dims=missing_dims)
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\variable.py", line 1378, in isel
return self[key]
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\variable.py", line 899, in getitem
dims, indexer, new_order = self._broadcast_indexes(key)
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\variable.py", line 732, in _broadcast_indexes
self._validate_indexers(key)
File "C:\Users\Modeller.PSRC\Anaconda3\envs\asim_fix_mem_use\lib\site-packages\xarray\core\variable.py", line 774, in _validate_indexers
raise IndexError(
IndexError: Boolean array size 1728 is used to index array with shape (96, 210).
'''

@dhensle
Copy link
Contributor

dhensle commented Oct 1, 2024

Consolidating issue to #830.

@dhensle dhensle closed this as completed Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working/bug f
Projects
None yet
Development

No branches or pull requests

3 participants