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

Issue When Running run_model.py (Key Error) #292

Closed
techGIAN opened this issue Jul 29, 2022 · 1 comment
Closed

Issue When Running run_model.py (Key Error) #292

techGIAN opened this issue Jul 29, 2022 · 1 comment

Comments

@techGIAN
Copy link

techGIAN commented Jul 29, 2022

I have already installed the necessary requirements and now about to try to run run_model.py (with map matching task, STMatching model and T_DRIVE_SMALL dataset, and the rest remains default) however I am getting a key error. I am not sure how I can resolve the error? Thank you so much.

gcalix@tiger:~/Bigscity-LibCity$ python run_model.py --task map_matching --model STMatching --dataset T_DRIVE_SMALL 2022-07-28 20:24:15,996 - INFO - Log directory: ./libcity/log 2022-07-28 20:24:15,996 - INFO - Begin pipeline, task=map_matching, model_name=STMatching, dataset_name=T_DRIVE_SMALL, exp_id=87895 2022-07-28 20:24:15,996 - INFO - {'task': 'map_matching', 'model': 'STMatching', 'dataset': 'T_DRIVE_SMALL', 'saved_model': True, 'train': False, 'seed': 0, 'dataset_class': 'MapMatchingDataset', 'executor': 'MapMatchingExecutor', 'evaluator': 'MapMatchingEvaluator', 'k': 5, 'r': 200, 'mu': 0, 'sigma': 20, 'window_size': 40, 'delta_time': True, 'metrics': ['RMF', 'AN', 'AL'], 'save_modes': ['csv'], 'geo': {'including_types': ['Polygon'], 'Polygon': {'row_id': 'num', 'column_id': 'num'}}, 'grid': {'including_types': ['state'], 'state': {'row_id': 32, 'column_id': 32, 'inflow': 'num', 'outflow': 'num'}}, 'data_col': ['inflow', 'outflow'], 'data_files': ['T_DRIVE_SMALL'], 'geo_file': 'T_DRIVE_SMALL', 'output_dim': 2, 'init_weight_inf_or_zero': 'inf', 'set_weight_link_or_dist': 'dist', 'calculate_weight_adj': False, 'weight_adj_epsilon': 0.1, 'time_intervals': 3600, 'device': device(type='cuda', index=0), 'exp_id': 87895} Traceback (most recent call last): File "run_model.py", line 38, in <module> train=args.train, other_args=other_args) File "/home/gcalix/Bigscity-LibCity/libcity/pipeline/pipeline.py", line 46, in run_model dataset = get_dataset(config) File "/home/gcalix/Bigscity-LibCity/libcity/data/utils.py", line 22, in get_dataset config['dataset_class'])(config) File "/home/gcalix/Bigscity-LibCity/libcity/data/dataset/map_matching_dataset.py", line 48, in __init__ self.with_rd_speed = ('speed' in config['rel']['geo'].keys()) File "/home/gcalix/Bigscity-LibCity/libcity/config/config_parser.py", line 141, in __getitem__ raise KeyError('{} is not in the config'.format(key)) KeyError: 'rel is not in the config

@aptx1231
Copy link
Member

STMatching is a road network matching model for mapping GPS trajectories to corresponding road segments. But T-Drive-Small is a gridded traffic flow dataset, not the original Beijing trajectory data, so this is a mismatch, so it will report an error.
The matching relationship between the model and the data can be found in this link.
If you need to match the original T-Drive trajectory data to the road network, you can process T-Drive into a trajectory atomic file, and then you can use the code in LibCity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants