Open Roadsong opened 2 years ago
Can you try switching all three repos (BEHAVIOR, iGibson, BDDL) to the behavior_replay branch and try again?
My bad - you don't need the BEHAVIOR repo for this. Just the iGibson repo (behavior-replay branch) and the BDDL repo (also behavior-replay). The replay script will be in examples/behavior/behavior_demo_replay I think.
You also need the behavior-replay copy of ig_dataset (https://storage.googleapis.com/gibson_scenes/ig_dataset_replay.zip) and of the robot assets (https://github.com/StanfordVL/ig_assets/tree/behavior-replay).
So essentially you need all four components to be behavior_replay copies:
Hi @cgokmen, thanks for you quick reply. I basically followed your advice and installed suggested version/branches, etc.
BEHAVIOR: null iGibson: behavior-replay branch. BDDL: behavior_refactor_verified_problems branch. Dataset version: v2.0.1, downloaded. Assets: downloaded.
Installed in a conda environment, created by conda create -n replay python=3.7
Install iGibson by pip install -e ./iGibson
Install BDDL by python setup.py install
(behavior_refactor_verified_problems branch)
Command: python -m igibson.examples.behavior.behavior_demo_replay
Results:
Traceback (most recent call last):
File "/Users/xxx/opt/anaconda3/envs/replay/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/xxx/opt/anaconda3/envs/replay/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/xxx/Desktop/research/replay/iGibson/igibson/examples/behavior/behavior_demo_replay.py", line 280, in <module>
main()
File "/Users/xxx/Desktop/research/replay/iGibson/igibson/examples/behavior/behavior_demo_replay.py", line 268, in main
bddl.set_backend("iGibson")
File "/Users/xxx/Desktop/research/replay/bddl/bddl/__init__.py", line 10, in set_backend
from igibson.task.bddl_backend import IGibsonBDDLBackend
ModuleNotFoundError: No module named 'igibson.task'
It seems that the iGibson's behavior-replay
branch is not compatible with something else. I do find igibson.task
code in the main branch and I am not sure if the problem can be solve if I manually include those code into the current behavior-replay
branch.
Something else: Also, I simply find that in BDDL repo behavior_refactor_verified_problems
branch, the pytest
cannot pass. As of https://github.com/StanfordVL/bddl/issues/10#issuecomment-1022554441 mentioned, a correct branch/commit of BDDL is really hard to find.
If I somehow changed the BDDL branch to master branch, the behavior-replay
branch of iGibson code does not work because
Traceback (most recent call last):
File "/Users/xxx/opt/anaconda3/envs/replay/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/xxx/opt/anaconda3/envs/replay/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/xxx/Desktop/research/replay/iGibson/igibson/examples/behavior/behavior_demo_replay.py", line 15, in <module>
from igibson.activity.activity_base import iGBEHAVIORActivityInstance
File "/Users/xxx/Desktop/research/replay/iGibson/igibson/activity/activity_base.py", line 6, in <module>
from bddl.activity_base import BEHAVIORActivityInstance
ModuleNotFoundError: No module named 'bddl.activity_base'
It seems that the master
branch code of iGibson
and BDDL
works better (at least I can see the windows).
I have pushed a behavior-replay branch onto BDDL, can you try using that? Thanks.
Hi @cgokmen, thanks for your time and effort.
I basically somehow managed to reproduce the demo on a mac machine using the behavior-replay
branch of iGibson and behavior_verfied_problems
branch of BDDL. Surely I include the missing code and files, and I also did some necessary modifications to make it work. I am glad to see a demo running on a window, e.g., cleaning_windows, even the results are not successful. However, it seems that for deterministic replay (exact match of every single steps), I must get everything work on a windows machine, since the pybullet-svl
library may yield different results across platforms (as mentioned in https://github.com/StanfordVL/bddl/issues/10#issuecomment-1022562103)
So, I tried to reproduce this in a virtual win 10 machine to see if the full deterministic replay is possible. That was not easy because I was using a virtual win 10 machine (to be specific, the host os is MacOS, and the guest OS is Win10 running on Parallel Desktop, the graphic card is AMD series). After fixing some issues and installing a good vs compiler, I could successfully build and install the iGibson, and BDDL seemed to work (I tried behavior-replay
branch this time).
However, I got the following problem this time:
ERROR: Failed to create GLFW window.
Well, I found this error was trigger by https://github.com/StanfordVL/iGibson/blob/58ac14cf62949008b6851a5a95602cd5084edffd/igibson/render/cpp/glfw_mesh_renderer.cpp#L91
because glfwCreateWindow
was not successful.
I googled a lot about this problem, especially paid attention to some platform-specific questions and answers. The results were mixed and I suspect that the glfw
cannot (easily) work on a win 10 guest machine running on parallel desktop. It looks like the OpenGL support from parallel desktop is not good enough, yet I was not sure about this.
My question is, can I at least do some test on a virtual windows machine without Nvidia graphic cards, CUDA, etc? It seems that the MacOS without Nvidia and CUDA seems fine except the determinism problem. Or, I must have a physical win 10 machine and satisfy the requirements https://stanfordvl.github.io/iGibson/installation.html#system-requirements?
Edit: I test some functions in script https://github.com/StanfordVL/iGibson/blob/master/tests/test_render.py and it gave me the same GLFW errors.
As far as I know you do need a Windows machine with a GPU, but let me defer to @fxia22 who will know these requirements better. Perhaps you could get one on Azure or something? Even a somewhat older GPU like a 1080 will work fine for this purpose. Sorry I can't be more helpful.
Hi @cgokmen, thanks for your time and effort again, you really helped a lot! You don't need to answer the following questions, I just want to update the issue in case anyone else has similar problems.
Basically I used a physical windows machine (without GPU, but I don't think GPU is the cause of following problems). I debug and read the source code carefully and found that I still couldn't reproduce an activity deterministically.
behavior-replay
branchv2.0.1
v2.0.6
bottling_fruit_0_Wainscott_0_int_0_2021-05-24_19-46-46.hdf5
can be downloaded at this linkpython -m igibson.examples.behavior.behavior_demo_replay --mode="headless" --vr_log_path="xxx.hdf5"
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
----- Writing log data to hd5 on frame: 200 -----
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
----- Writing log data to hd5 on frame: 400 -----
----- Writing log data to hd5 on frame: 600 -----
----- Writing log data to hd5 on frame: 800 -----
----- Writing log data to hd5 on frame: 1000 -----
----- Writing log data to hd5 on frame: 1200 -----
----- Writing log data to hd5 on frame: 1400 -----
----- Writing log data to hd5 on frame: 1600 -----
----- Writing log data to hd5 on frame: 1800 -----
----- Writing log data to hd5 on frame: 2000 -----
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
WARNING:root:Trying to set hidden state before vertices are merged, converted to no-op
----- Writing log data to hd5 on frame: 2200 -----
----- Writing log data to hd5 on frame: 2400 -----
----- Writing log data to hd5 on frame: 2600 -----
----- Writing log data to hd5 on frame: 2800 -----
----- Writing log data to hd5 on frame: 3000 -----
Demo was succesfully completed: False
IG LOGGER INFO: Ending log writing session after 3000 frames
Mismatch for obj 120 with mismatched attribute joint_state starting at timestep 443
Mismatch for obj 163 with mismatched attribute joint_state starting at timestep 1
Mismatch for obj 163 with mismatched attribute orientation starting at timestep 1
Mismatch for obj 163 with mismatched attribute position starting at timestep 1538
Mismatch for obj 164 with mismatched attribute joint_state starting at timestep 2
Mismatch for obj 164 with mismatched attribute orientation starting at timestep 2
Mismatch for obj 164 with mismatched attribute position starting at timestep 1654
Mismatch for obj 165 with mismatched attribute orientation starting at timestep 2
Mismatch for obj 165 with mismatched attribute position starting at timestep 1515
Mismatch for obj 199 with mismatched attribute orientation starting at timestep 577
Mismatch for obj 199 with mismatched attribute position starting at timestep 606
Mismatch for obj 202 with mismatched attribute orientation starting at timestep 919
Mismatch for obj 202 with mismatched attribute position starting at timestep 919
Mismatch for obj 270 with mismatched attribute orientation starting at timestep 0
Mismatch for obj 270 with mismatched attribute position starting at timestep 0
Demo was deterministic: False
I was really concerned about the obj 270, since mismatch started at timestep 0, and it proved to be the Behavior Robot itself.
'/', '/agent_actions', '/agent_actions/vr_robot',
'/frame_data',
'/goal_status', '/goal_status/satisfied', '/goal_status/unsatisfied',
'/physics_data',
'/physics_data/1', '/physics_data/1/joint_state', '/physics_data/1/orientation', '/physics_data/1/position',
'/physics_data/103', '/physics_data/103/joint_state', '/physics_data/103/orientation', '/physics_data/103/position',
'/physics_data/107', '/physics_data/107/joint_state', '/physics_data/107/orientation', '/physics_data/107/position',
'/physics_data/120', '/physics_data/120/joint_state', '/physics_data/120/orientation', '/physics_data/120/position',
'/physics_data/163', '/physics_data/163/joint_state', '/physics_data/163/orientation', '/physics_data/163/position',
'/physics_data/164', '/physics_data/164/joint_state', '/physics_data/164/orientation', '/physics_data/164/position',
'/physics_data/165', '/physics_data/165/joint_state', '/physics_data/165/orientation', '/physics_data/165/position',
'/physics_data/199', '/physics_data/199/joint_state', '/physics_data/199/orientation', '/physics_data/199/position',
'/physics_data/202', '/physics_data/202/joint_state', '/physics_data/202/orientation', '/physics_data/202/position',
'/physics_data/270', '/physics_data/270/joint_state', '/physics_data/270/orientation', '/physics_data/270/position',
'/vr', '/vr/vr_button_data', '/vr/vr_button_data/left_controller', '/vr/vr_button_data/right_controller',
'/vr/vr_camera', '/vr/vr_camera/right_camera_pos', '/vr/vr_camera/right_eye_proj', '/vr/vr_camera/right_eye_view',
'/vr/vr_device_data', '/vr/vr_device_data/hmd', '/vr/vr_device_data/left_controller', '/vr/vr_device_data/right_controller', '/vr/vr_device_data/torso_tracker', '/vr/vr_device_data/vr_position_data',
'/vr/vr_event_data', '/vr/vr_event_data/left_controller', '/vr/vr_event_data/reset_actions', '/vr/vr_event_data/right_controller',
'/vr/vr_eye_tracking_data'
print(hdf5_file['/physics_data/270/position'][0])
, and the results is [3.19985637 8.89955767 0.50084959]
urdf
file do? It basically load all the attributes of each object (either interactive or non-interactive, and either task-relevant or task-irrelevant). Given a specific hdf5 file, we found a specific urdf file in the assets folder (in this case Wainscott_0_int_bottling_fruit_0_0_fixed_furniture
) and initialize a specific task and create and then load necessary things, and take recorded actions in iGibson to reproduce it.'BRBody_1': {'xyz': array([3.20019555, 8.90034866, 0.49919999]), 'rpy': array([-7.12756938e-04, 3.87323983e-04, -8.18337575e-05])}
and the position (xyz) is slightly different from what we saw in the HDF5 file.v2.0.6
and v2.0.1
are different. Do we have v2.0.1
of assets that may have slight differences?v2.0.6
, maybe the older version has been overwritten by the new one. But I am not so sure. @fxia22 do you have any opinions?
There are basically two methods I tried to replay (as of June 14).
Method 1
BEHAVIOR: master branch. iGibson: master branch. BDDL: master branch. Dataset: version 2.0.6.
Command:
python -m igibson.examples.learning.demo_replaying_examples
Results: I can see the demo, but the the motion of the robot is different from ground truth environment. I believe I faced a similar (or even worse) issue as https://github.com/StanfordVL/iGibson/issues/161#issuecomment-1022341060. I know it may because I am not running demos on a Windows machine, but it also shows the below messages and I don't know what's going on. I simply cannot find thevr-demo-collection
branch at all. Also, the version 2.0.6 is suspicious, I don't know which version is correct for reproducing the demo.Method 2
BEHAVIOR: master branch. iGibson: behavior-replay branch. BDDL: master branch / behavior-refactored-verified-problems. Dataset: version 2.0.6.
Command:
python -m igibson.examples.behavior.behavior_demo_replay
Results: Error, no module named 'bddl.activity_base'. / Error, no module named 'igibson.task'Summary
In short, impossible to replay at all. Can anyone write a detailed instructions on that? If you want the benchmark get attention, at least people can reproduce the basic things easily, right? Many instructions are not up-to-date and show many inconsistencies. Can anyone tells me which one is the correct one to reproduce the vr demo? This https://github.com/StanfordVL/behavior/blob/main/docs/vr_demos.md does not work.