-
Notifications
You must be signed in to change notification settings - Fork 184
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
Support for MiniWorld (3D indoor environment)? #13
Comments
Hi Maxime, This is a really great project!!! For the first issue, is it still an issue after I modified the network to automatically adapt it to the size of the images? Thank you for the issues. I will try your code as soon as possible. |
Thanks Lucas. I will keep improving upon it :) I tried the following comman for training:
It produces the following error:
Because it expects observations to have a dictionary observation space. I think it would be good to support both dict and RGB observation spaces. This would allow your RL code to work not just with MiniWorld, but also with the Atari environments. |
If I assume that the |
Yes, if I had to do it again I would make the MiniGrid obs space just a numpy array, and pass the mission string through the |
I see what you mean. So, you will never do changes that are no retro compatible? Are their instructions in MiniWorld? |
I will try to avoid breaking changes if I can. Right now there are no instructions in MiniWorld, but there will be eventually. When there are instructions I will add them through the |
I would like to do a clean code that would define a observation space based on the kind of environment, i.e. if it is a minigrid environment, then ..., else if it is a MiniWorld environment then, otherwise ... . Do you have an idea of how to do that? For example, is it possible to get the id of the environment? I don't find how to get it... If yes, then I could filter using regexs. |
You could check if the observation space is an instance of https://github.com/openai/gym/blob/master/gym/spaces/dict_space.py |
Thank you for the solution. But doing the disjunction on the observation space is not the good thing to do I think. It doesn't make the code easy to understand. |
The good thing is that if you check based on the observation space, you could handle not just MiniWorld, but also all other environments which produce an RGB pixel array as observations (eg: Atari, VizDoom, etc). |
What is the FPS you get with the RL code you actually use? |
1600-2200FPS on a Core i7 3.5 with a Titan Xp, 16 processes. |
Sorry, I meant, what is the FPS you get with the other RL code you use (not mine)? https://github.com/maximecb/gym-miniworld/tree/master/pytorch-a2c-ppo-acktr |
Yes that's what I meant. |
Sorry, I misread your answer... I thought you wrote 16 FPS... This confused me. I will try to increase the FPS |
Last thing, you used PPO right? |
Yes, with this command to launch training:
|
Maybe we can continue the discussion on this issue.
A problem with this modifications is that it doesn't make MiniGrid working anymore. |
I'm not sure what's happening, it seems like you're maybe trying to send information across processes that shouldn't be sent, like whole environments? Something that contains pointers? What's the error with MiniGrid? |
Sorry, I forgot to add the error. This is the end of the error:
I don't put the whole error because it is very huge. I am investigating this page: pytorch/pytorch#3492 |
Ok. Seems like you might want to call |
But, even if I put this at the very beginning of my code, I still have the same error. I don't really understand what is happening... |
I'm trying to make it work again. If it fails with multiple processes, I would say try to debug with one process. I put the
I also just submitted a PR for a minor issue that showed up after I upgraded to PyTorch 1.0. |
I have it training on the Hallway level with a single process. There's still some issue when the number of processes is greater than 1. |
I got it to work. The environments need to be created inside the worker processes rather than in the main process. To do this, I pass a Also, to solve that error you were getting wrt
Otherwise every process tries to run the code in main, and that's why things break down. |
Thank you! I will try to implement as soon as possible. It would be great if you can do a PR. |
Hi Maxime, I have some time again for this project. If you don't have the time for a PR, could you just send me the code that you modified (where you pickle and the |
Hi Lucas, Glad to hear you have time for this project. The code I had modified to work with MiniWorld is here: https://github.com/maximecb/gym-miniworld/tree/maxime-torchrl/torch-rl There might be some way to do a diff between this and your torch-ac repo to see exactly what's been changed. |
Thank you! I cloned
and got 35 FPS. It sounds strange, isn't it? I got this message:
Then, I executed:
and got also 35 FPS. Finally, I checked out your and got 100 FPS. I don't know what to conclude from my experiments. The FPS seems abnormally low. |
Yes these frame rates all seem very low, even for one process. The simulator is able to run much faster (you can try with I ran into the same problem the last time I tried it. I wasn't able to figure out what the issue was. I just remember it was way too slow when recurrence was activated. Worth doing some profiling. |
This is the benchmark I have:
|
It could definitely run much faster on your machine then. |
If I understand, it is slow because it takes a lot of time to reset? How could I fix it? I don't see the link with cloudpickle, etc... |
I don't think there is an issue with the environment because the ikostrikov RL code manages to run at 1000+ FPS on my desktop machine. Is it possible that your code and the ikostrikov code manage resetting of the environment differently? Maybe your code blocks all processes every time the environment resets and theirs doesn't? |
On my machine, the ikostrikov RL code is as slow as mine as written in my previous message... I can't reproduce the situation where its code is faster than mine... |
With multiple processes or with just 1? I usually train with 16+. |
Hi Lucas,
I've been working on my 3D indoor environment. It's still very basic, but it works, and I just made the repository public: https://github.com/maximecb/gym-miniworld
I've tried to adjust your
pytorch-a2c-ppo
code to work with MiniWorld, but ran into issues. One is that MiniWorld produces observations which are not dictionary-based, and it was awkward to support this (the obs are just 60x80x3 RGB arrays). The other is that I only got something like 16 frames per second while training with 16 processes, and I have no idea why.Would you have time to take a look? It would be great if it could work with your RL code out of the box. Right now I'm using my own fork of ikostrikov's, but there are multiple other issues with that code, one of which is that the performance when visualizing trained agents doesn't match the performance reported while training.
The text was updated successfully, but these errors were encountered: