Git Product home page Git Product logo

Comments (8)

xuanlinli17 avatar xuanlinli17 commented on August 23, 2024 1

README pull request submitted.

from maniskill.

xiqiangliu avatar xiqiangliu commented on August 23, 2024

Yes, the default behavior of replay_trajectory.py is replaying under the obs_mode of the input trajectories. The reason for such design is that some environments could potentially not have a none observation mode and replaying under none will lead to an error. We will update the README soon to point out this behavior.

Thank you for bringing up this suggestion!

from maniskill.

DanielTakeshi avatar DanielTakeshi commented on August 23, 2024

@xuanlinli17 Sorry for bumping a closed report (I can make a new one if you want), but how do you suggest dealing with Pour-v0 which has the particles type? If I do something like:

python tools/replay_trajectory.py --traj-path /data/seita/maniskill2/demos/soft_body_envs/Pour-v0/trajectory.h5   --save-traj  --target-control-mode pd_joint_delta_pos --num-procs 5

Then I will get:

Traceback (most recent call last):
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/seita/ManiSkill2/tools/replay_trajectory.py", line 266, in _main
    ori_env = gym.make(env_id, **ori_env_kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 184, in make
    return registry.make(id, **kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 106, in make
    env = spec.make(**kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 76, in make
    env = cls(**_kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/mpm/pour_env.py", line 98, in __init__
    super().__init__(*args, **kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/mpm/base_env.py", line 92, in __init__
    super().__init__(*args, **kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/sapien_env.py", line 86, in __init__
    raise NotImplementedError("Unsupported obs mode: {}".format(obs_mode))
NotImplementedError: Unsupported obs mode: particles

This is the only remaining environment where I'm not sure about the intended behavior as per the README. The other 7 available envs all seem to be working as intended with tools/replay_trajectory.py as per the current README, when the intent is to only convert actions into control mode and not record observations:

We recommend using our script only for converting actions into different control modes and not record any observation information (i.e. without passing --obs-mode).

from maniskill.

xuanlinli17 avatar xuanlinli17 commented on August 23, 2024

We have updated our readme (i.e. passing --obs-mode=none).

from maniskill.

DanielTakeshi avatar DanielTakeshi commented on August 23, 2024

Ah! Apologies, I was looking at an older commit. I have tried the command from the existing README and with --obs-mode none (or --obs-mode=none, --obs-mode=None) I get:

(mani_skill2) seita@takeshi:~/ManiSkill2 (main)$ python tools/replay_trajectory.py --traj-path /data/seita/maniskill2/demos/soft_body_envs/Pour-v0/trajectory.h5  --save-traj --target-control-mode pd_joint_delta_pos --obs-mode none --num-procs 5
                      Warp initialized:
   Version: 0.3.1ep/s]
   CUDA device: NVIDIA GeForce RTX 3090
   Kernel cache: /home/seita/.cache/warp/0.3.1
Warp initialized:ep/s]
   Version: 0.3.1
   CUDA device: NVIDIA GeForce RTX 3090
   Kernel cache: /home/seita/.cache/warp/0.3.1
Warp initialized:
   Version: 0.3.1
   CUDA device: NVIDIA GeForce RTX 3090
   Kernel cache: /home/seita/.cache/warp/0.3.1
Warp initialized:
   Version: 0.3.1
   CUDA device: NVIDIA GeForce RTX 3090
   Kernel cache: /home/seita/.cache/warp/0.3.1
Warp initialized:
   Version: 0.3.1
   CUDA device: NVIDIA GeForce RTX 3090
   Kernel cache: /home/seita/.cache/warp/0.3.1
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/seita/ManiSkill2/tools/replay_trajectory.py", line 266, in _main
    ori_env = gym.make(env_id, **ori_env_kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 184, in make
    return registry.make(id, **kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 106, in make
    env = spec.make(**kwargs)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/site-packages/gym/envs/registration.py", line 76, in make
    env = cls(**_kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/mpm/pour_env.py", line 98, in __init__
    super().__init__(*args, **kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/mpm/base_env.py", line 92, in __init__
    super().__init__(*args, **kwargs)
  File "/home/seita/ManiSkill2/mani_skill2/envs/sapien_env.py", line 86, in __init__
    raise NotImplementedError("Unsupported obs mode: {}".format(obs_mode))
NotImplementedError: Unsupported obs mode: particles
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "tools/replay_trajectory.py", line 423, in <module>
    main()
  File "tools/replay_trajectory.py", line 404, in main
    res = pool.starmap(_main, proc_args)
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
NotImplementedError: Unsupported obs mode: particles
/home/seita/miniconda3/envs/mani_skill2/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 5 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
(mani_skill2) seita@takeshi:~/ManiSkill2 (main)$ 

I also get the same with --obs-mode=pointcloud and --obs-mode=particles, and --obs-mode=rgbd into the above command. Am I using the command correctly? Note that I moved the demos/ directory to a new directory on my hard disk drive in the command but that shouldn't have affected things.

from maniskill.

xuanlinli17 avatar xuanlinli17 commented on August 23, 2024

Could you redownload the demonstrations? We recently changed all raw soft body demonstrations to use obs_mode=none.

from maniskill.

DanielTakeshi avatar DanielTakeshi commented on August 23, 2024

That seems to have fixed it! Thanks for the recommendation to re-download.
Though to clarify this is not going to change the nature of the demonstrations (they will still follow the same trajectory when you visualize them) but just changing some metadata?

from maniskill.

xuanlinli17 avatar xuanlinli17 commented on August 23, 2024

Yes it is. You can visualize it again.

from maniskill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.