-
Notifications
You must be signed in to change notification settings - Fork 24
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
Problems about scenarios convertion #78
Comments
Hi Chris, Did you try following these installation instructions? https://scenarionet.readthedocs.io/en/latest/ For the different state dimensions, it is because the |
Thank you so much for the guide. For PG, it seems that there's no argument for the metadrive parameters like map, traffic_density, etc. So is there any way to tune these parameters before converting to scenarios? |
You are correct. Currently, we hardcode it at:
Feel free to modify it to get scenarios you want. |
Yes, now I can generate scenarios with settings. But can I generate several datasets of scenarios varying only one parameter? For example, I want to set the traffic_density to be 0.1, 0.2, 0.3 and generate 10 scenarios for each density. If I tune the density and let it generate 3 times, the maps of the 3 datasets will also be different. So is there any way I could set a seed for the repeated generation? Another question is whether it says that the saved scenarios support imitation learning in the document. However, I haven't figured out how to access the expert rollouts. Are there any instructions on this? |
For the first question, I think the program should work as what you want. That is strange. The data collection program will use this function to collect episodes: https://github.com/metadriverse/metadrive/blob/233a3a1698be7038ec3dd050ca10b547b4b3324c/metadrive/envs/base_env.py#L801 It is clear that each environment will be seeded, so it is not possible to have different map structures given the same seed... Could you try diving into this function and make sure that the same seed results in different map structures across different trials? If it is confirmed, please provide me script to reproduce the issue. and I will look into it. For the second question, this is a bit confusing. For our internal use, all |
For the first one, I just use
to get two datasets with traffic densities equal to 0.1 and 0.2 respectively. Then I just use replay ego car policy to generate corresponding videos.
After comparing the 10 videos from the two datasets, I found out that they have different maps. And I think in convert_pg.py, we don't have parameters to control whether we want same maps or not. For the second one, I just want to ask how to get the rollouts for imitation learning. For RL, I can use stable baseline like this:
,which is straightforward. But if I want to use the "Imitation" repo, I didn't find the rollouts. For example,In the pg data directory
There are many .pkl files for one scenario. Shall I use pickle load these .pkl files? Or Is there easier way to do imitation learning? |
Sorry, I made a mistake. The pg scenarios collected indeed have the same map. They are seeded by the scenario_index in convert_pg_scenario:
My problem is caused by the wrapper where I changed the env seed in the reset function. Thank you for your patience. For imitation learning, I know we can use the ReplayEgoCar policy to replay the scenarios and save obs and acts by ourselves. But is there easier method to directly access those data from the saved pkl files? Since it can be replayed, I thought the rollouts should have already been saved. |
The .pkl file is a dictionary, so just load it and you can access the |
I tried to open the pkl file but I haven't found the place for obs and actions in a scenario.
And I print all the keys in it:
Then all the keys under track field:
Now I'm confused, what do these tokens mean? Do they represent different objects in one scenario? I keep exploring the keys under these token field:
And for some tokens, there are action key under state key, but I don't know what do they mean and I didn't see keys like observations. Could you provide more instructions on how to get expert trajectories with the pkl file? Or I could also use the ReplayEgoCar policy to replay the scenario and save the obs by myself but how can I get the replay actions in this way? |
Hello scenarionet team,
Thanks for the great work.
I'm trying to use conver_xx.py under scenario_net directory to prepare some datasets. However, only convert_pg.py works fine and all the other codes will raise errors like lack of modules or files. I wonder if I need to install extra packges before using them. Here are the detailed error message:
Besides, for the conversion of pg, the original state dimension of metadrive is 19 and after coversion it's 41. May I ask how the state dimension is enlarged or which file should I look into to understand the conversion?
And how can I adjust the parameters of pg maps, like traffic density, map horizon?
The text was updated successfully, but these errors were encountered: