btx0424 / OmniDrones

https://omnidrones.readthedocs.io/
MIT License
147 stars 25 forks source link

train_lidar.py KeyError: 'Forest' #62

Closed Zhefan-Xu closed 6 months ago

Zhefan-Xu commented 6 months ago

Hi, thanks for providing this great project. I would like to try train_lidar for forest navigation task. I have completed the environment setup and run the example demo train.py without issue. My Isaac Sim version is: 2023.1.0-hotfix. Below is my output:

Traceback (most recent call last):
  File "/home/zhefan/isaac-sim/OmniDrones/scripts/train_lidar.py", line 397, in <module>
    main()
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/main.py", line 94, in decorated_main
    _run_hydra(
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
    _run_app(
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/utils.py", line 457, in _run_app
    run_and_report(
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
    raise ex
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
    return func()
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
    lambda: hydra.run(
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/_internal/hydra.py", line 132, in run
    _ = ret.return_value
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/core/utils.py", line 260, in return_value
    raise self._return_value
  File "/home/zhefan/Packages/miniconda3/envs/sim/lib/python3.10/site-packages/hydra/core/utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "/home/zhefan/isaac-sim/OmniDrones/scripts/train_lidar.py", line 200, in main
    env_class = IsaacEnv.REGISTRY[cfg.task.name]
KeyError: 'Forest'

I appreciate your suggestions and thanks in advance.

Zhefan-Xu commented 6 months ago

I figured it out myself, it turns out that in omni_drones/envs/__init__.py the Forest environment requires install Isaac Orbit.

try:
    from .pinball import Pinball
    from .forest import Forest
except ModuleNotFoundError:
    print(
        "To run the environments which use `ContactSensor` and `RayCaster`,"
        "please install Isaac Orbit (https://github.com/NVIDIA-Omniverse/orbit)."
    )

I was able to run launch the forest trainig but it seems my pc doesn't have enough GPU (RTX 3080) memory. Could I ask what GPU is expected to train Forest task or if there is a way to reduce the memory usage. Thank you!

btx0424 commented 6 months ago

Hi there. Try reducing the number of environments, e.g., task.env.num_envs=512. I am currently using an RTX4070 laptop so I believe your RTX 3080 should be fine. I am also refactoring the repo to add an option that disables rendering, which saves 1~2G GPU memory.

Meanwhile, may I kindly ask what you are planning to do with this repo?

Zhefan-Xu commented 6 months ago

Thank you very much! I reduce the num_env param and everything works just fine. I was planning to learn and see if there is any potential project for drone navigation.