Unable to run train_experiment.py in baselines/RLLib_training

Hi,

I am trying to run train_experiment.py (located in baselines/RLLib_training) and I am getting the following error:

File RLLib_training/RailEnvRLLibWrapper.py", line 66, in reset
data, distance, agent_data = self.env.obs_builder.split_tree(tree=np.array(obs[i_agent]),
AttributeError: ‘TreeObsForRailEnv’ object has no attribute ‘split_tree’

I tried to fix it by importing the split_tree method from utils.observation_utils and setting the num_features_per_node=self.env.obs_builder.observation_dim, but then the following error appears:
ValueError: Cannot feed value of shape (7, 378) for Tensor ‘ppo_policy/obs:0’, which has shape ‘(?, 336)’

What changes do I need to make in order to run it successfully?

Thanks!

Hi !
I pushed an updated version of the RLLib_training folder. Hopefully it should be all working now. It was just because of some changes in the flatland repo that I didn’t take into account.
Sorry for the delay ! If you encounter any other problem, feel free to share it, I’ll try to be more reactive.

Hi,

When I start train_experiment.py I still get the same error (‘TreeObsForRailEnv’ object has no attribute ‘split_tree’), but I was able to make it work by just importing the split_tree method from observation_utils, and setting the num_features_per_node parameter.

Thanks!

Hi @ai-team-flatland-net

Yes this has changed. Since the split-tree is just a utility function it was moved out from the tree observation. Just be sure that you update all the variables such as num_features_per_node so that the split tree does split the different values correctly . Check out how it can be used in the baselines repo:

Hope this helps resolving your issues.

Best regards,
Erik