Comments (8)
@takuma-ynd if you want to switch to loading these environments manually you can modify the logic here: https://github.com/facebookresearch/habitat-api/blob/master/habitat/core/env.py#L178-L184 . On a reset call the episode index is advanced and the reconfigure
in line 185 then loads the house from new episode into the simulator.
I think you might have already identified this but stating it to be clear, it is important for training the PPO that the episodes are randomly sampled, but there is a trade-off here, if you randomly sample the episode it is likely that each successive episode will be in a different environment, this is not good in terms of speed as this would mean that there would be loading and dumping of graphical assets in the simulator which is usually a slow step, a way around this is if you shuffle the episodes such that consecutive shuffle_interval
episodes happen inside the same house, in our experiments we used a shuffle_interval
value of 500:
def shuffle_episodes(self, shuffle_interval):
ranges = np.arange(0, len(self.episodes), shuffle_interval)
np.random.shuffle(ranges)
new_episodes = []
for r in ranges:
new_episodes += self.episodes[r:r + shuffle_interval]
self.episodes = new_episodes
This method would be present inside the PointnavDatasetV1 class and the method would be called just after the dataset is created (after this line)
Ideally this method should have been part of the original codebase which was opensourced, if you do end up using this or any other modification of shuffling can you go ahead and open a PR for this.
Let me know if you have any other questions. Thanks 🙂
from habitat-lab.
Just to update this, there now appears to be a way to force a switch, present in the episode iterator's __next__
method
https://github.com/facebookresearch/habitat-api/blob/master/habitat/core/dataset.py#L391
from habitat-lab.
This is what initiates a scene switch: https://github.com/facebookresearch/habitat-api/blob/master/habitat/core/dataset.py#L249 -- the environment then just tells the simulator what scene to load for a given episode.
We currently don't have a way to force a scene switch with a method call.
from habitat-lab.
Hi @a7b23, that means that first scene that Simulator will load will be the one specified in the first episode of a dataset.
Regarding train.json
all episodes are loaded from subfolder content
that contains scene based episodes.
from habitat-lab.
Feel free to re-open the issue, if you still have questions.
from habitat-lab.
I understand that when we use train.json
, all episodes are loaded from subfolder content
, but how can we switch those loaded environments manually?
When I read train.ppo, I got confused because I couldn't find any code that explicitly switches environments.
In addition, I could not find anything for switching environments in Env class, either.
Could you clarify this point?
Thanks!
from habitat-lab.
So how to switch scene exactly? I'm still confused after reading the response.
from habitat-lab.
The example how the scene can be switched in the PointNav task (you may do the scene switch for the other tasks by following the same logic):
from habitat.datasets.pointnav.pointnav_generator import generate_pointnav_episode
from habitat.tasks.nav.nav import merge_sim_episode_config
# 1. switch the scene to new_scene
sim_config.defrost()
sim_config.SCENE = new_scene
sim_config.freeze()
sim.reconfigure(sim_config)
# 2. generate the episode for new_scene
episode_gen = generate_pointnav_episode(
sim=sim,
is_gen_shortest_path=False
)
new_episode = next(episode_gen)
sim_config.defrost()
sim_config = merge_sim_episode_config(
sim_config,
new_episode
)
sim_config.freeze()
sim.reconfigure(sim_config)
# 3. reset the sim
obs = sim.reset()
# 4. do what you want
For more detailed implementation you may refer to this code.
Feel free to re-open the issue, if you still have questions.
from habitat-lab.
Related Issues (20)
- RLEnv seed function accepts seed as optional and default to None
- original_action_space attribute missing
- VQA test in EQA baseline implement
- Can not setup
- BrokenPipeError: [Errno 32] Broken pipe error While evaluating the trained Social Nav agent. HOT 1
- How to load different scenes into the interactive play script?
- How is the instruction flow from High level planner to low level skills (Pick and Place) HOT 1
- Unable to load semantic annotation for Scene HOT 5
- Unable to evaluate the Social Navigate Benchmark in Habitat 3.0 using the social_nav_latest.pth checkpoint. AttributeError: Can't get attribute 'HeadStereoLeftDepthSensorConfig'
- Is there a sensor producing height coordinate of the robot's position?
- How to use Habitat3 to train and evaluate my new transformer based vision language navigation system?
- Add a new robot into one of the habitats scenes HOT 1
- Collision handling between multiple humanoid agents HOT 2
- Is there any community for habitat-lab discussions? HOT 2
- DISPLAY not detected. For headless systems, compile with --headless for EGL support HOT 4
- Is there a way to improve the quality of rendered image of hm3d inside the habitat-lab? HOT 1
- Is it possible to upload gaussian splatting-based 3D world to Habitat simulator?
- Questions on Adding Humanoids in PointNav/ObjNav tasks in Habitat Environment HOT 4
- Not able to run examples.py
- data/humanoids/humanoid_data/walking_motion_processed.pkl not exist HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from habitat-lab.