Which RL-Library for variable Environment-Spaces?

Hello guys,

which library would be the best training a RL-Agent on different Environment spaces. I am working on a Scheduler, which schedules task to maschines. There are Dataset which contain for example 10 maschines and 50 operations and then 5 maschines and 20 operations. So my Gym Environment is changing based on different datasets. I get this error below when im using SB3:

My Question ist, are there librarys that can deal with this?

ValueError Traceback (most recent call last) Cell In[7], line 27 25 done = False 26 truncated = False ---> 27 model = MaskablePPO.load("ModelMK10", env=wrapped_env) 28 while not done and not truncated: 29 # Masken für gültige Aktionen 30 action_masks = get_action_masks(wrapped_env) File ~anaconda3Libsite-packagesstable_baselines3commonbase_class.py:717, in BaseAlgorithm.load(cls, path, env, device, custom_objects, print_system_info, force_reset, **kwargs) 715 env = cls._wrap_env(env, data["verbose"]) 716 # Check if given env is valid --> 717 check_for_correct_spaces(env, data["observation_space"], data["action_space"]) 718 # Discard `_last_obs`, this will force the env to reset before training 719 # See issue https://github.com/DLR-RM/stable-baselines3/issues/597 720 if force_reset and data is not None: File ~anaconda3Libsite-packagesstable_baselines3commonutils.py:317, in check_for_correct_spaces(env, observation_space, action_space) 305 """ 306 Checks that the environment has same spaces as provided ones. Used by BaseAlgorithm to check if 307 spaces match after loading the model with given env. (...) 314 :param action_space: Action space to check against 315 """ 316 if observation_space != env.observation_space: --> 317 raise ValueError(f"Observation spaces do not match: {observation_space} != {env.observation_space}") 318 if action_space != env.action_space: 319 raise ValueError(f"Action spaces do not match: {action_space} != {env.action_space}") ValueError: Observation spaces do not match: Dict('can_run_edge_attr': Box(0.0, inf, (716, 1), float32), 'can_run_edge_index': Box(0, 239, (2, 716), int64), 'machine': Box(0.0, 10.0, (15, 2), float64), 'operation': Box(0.0, 10.0, (240, 3), float64), 'precedes_edge_index': Box(0, 239, (2, 220), int64)) != Dict('can_run_edge_attr': Box(0.0, inf, (339, 1), float32), 'can_run_edge_index': Box(0, 299, (2, 339), int64), 'machine': Box(0.0, 10.0, (15, 2), float64), 'operation': Box(0.0, 10.0, (300, 3), float64), 'precedes_edge_index': Box(0, 299, (2, 280), int64))ValueError Traceback (most recent call last) Cell In[7], line 27 25 done = False 26 truncated = False ---> 27 model = MaskablePPO.load("ModelMK10", env=wrapped_env) 28 while not done and not truncated: 29 # Masken für gültige Aktionen 30 action_masks = get_action_masks(wrapped_env) File ~anaconda3Libsite-packagesstable_baselines3commonbase_class.py:717, in BaseAlgorithm.load(cls, path, env, device, custom_objects, print_system_info, force_reset, **kwargs) 715 env = cls._wrap_env(env, data["verbose"]) 716 # Check if given env is valid --> 717 check_for_correct_spaces(env, data["observation_space"], data["action_space"]) 718 # Discard `_last_obs`, this will force the env to reset before training 719 # See issue https://github.com/DLR-RM/stable-baselines3/issues/597 720 if force_reset and data is not None: File ~anaconda3Libsite-packagesstable_baselines3commonutils.py:317, in check_for_correct_spaces(env, observation_space, action_space) 305 """ 306 Checks that the environment has same spaces as provided ones. Used by BaseAlgorithm to check if 307 spaces match after loading the model with given env. (...) 314 :param action_space: Action space to check against 315 """ 316 if observation_space != env.observation_space: --> 317 raise ValueError(f"Observation spaces do not match: {observation_space} != {env.observation_space}") 318 if action_space != env.action_space: 319 raise ValueError(f"Action spaces do not match: {action_space} != {env.action_space}") ValueError: Observation spaces do not match: Dict('can_run_edge_attr': Box(0.0, inf, (716, 1), float32), 'can_run_edge_index': Box(0, 239, (2, 716), int64), 'machine': Box(0.0, 10.0, (15, 2), float64), 'operation': Box(0.0, 10.0, (240, 3), float64), 'precedes_edge_index': Box(0, 239, (2, 220), int64)) != Dict('can_run_edge_attr': Box(0.0, inf, (339, 1), float32), 'can_run_edge_index': Box(0, 299, (2, 339), int64), 'machine': Box(0.0, 10.0, (15, 2), float64), 'operation': Box(0.0, 10.0, (300, 3), float64), 'precedes_edge_index': Box(0, 299, (2, 280), int64)) 

submitted by /u/xEmpty__
[link] [comments]

Liked Liked