### Install VIP Package Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Installs the VIP package in editable mode from the current repository directory. ```bash pip install -e . ``` -------------------------------- ### Run Training for Locomotion Environments Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Starts the training process for locomotion environments like HalfCheetah. Requires a specified environment name and configuration file. ```bash python train_offline.py --env_name=halfcheetah-medium-expert-v2 --config=configs/mujoco_config.py ``` -------------------------------- ### Install System Dependencies Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Install necessary system packages for MuJoCo and rendering. This includes packages for CMake, MPI, OpenGL, and GLEW. ```bash $ sudo apt-get install cmake libopenmpi-dev libgl1-mesa-dev libgl1-mesa-glx libosmesa6-dev patchelf libglew-dev # software rendering $ sudo apt-get install libgl1-mesa-glx libosmesa6 patchelf # window rendering $ sudo apt-get install libglfw3 libglew-dev ``` -------------------------------- ### Basic CMake and Catkin Setup Source: https://github.com/clvrai/furniture-bench/blob/main/furniture_bench/assets/franka_description_ros/franka_description/CMakeLists.txt Sets the minimum CMake version, defines the project name, and finds the catkin package. It also declares catkin dependencies. ```cmake cmake_minimum_required(VERSION 3.4) project(franka_description) find_package(catkin REQUIRED) catkin_package(CATKIN_DEPENDS xacro) ``` -------------------------------- ### Install Directories Source: https://github.com/clvrai/furniture-bench/blob/main/furniture_bench/assets/franka_description_ros/franka_description/CMakeLists.txt Installs the 'meshes' and 'robots' directories to the catkin package's share destination. ```cmake install(DIRECTORY meshes DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) install(DIRECTORY robots DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) ``` -------------------------------- ### Install RoLF Package Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Install the Robot Learning Framework (RoLF) package in editable mode. This command should be run from the root directory of the project. ```bash # at the root directory (`robot_learning/`) $ pip install -e . ``` -------------------------------- ### Install Dependencies for Implicit Q-Learning Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Installs necessary Python packages, including JAX with CUDA support. Ensure your CUDA and cuDNN versions are compatible. ```bash pip install --upgrade pip pip install -r requirements.txt # Installs the wheel compatible with Cuda 11 and cudnn 8. pip install --upgrade "jax[cuda]>=0.2.27" -f https://storage.googleapis.com/jax-releases/jax_releases.html ``` -------------------------------- ### Run Finetuning on AntMaze Tasks Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Starts a finetuning process on AntMaze tasks. Allows for custom evaluation parameters and replay buffer size. Requires specifying the environment and configuration. ```bash python train_finetune.py --env_name=antmaze-large-play-v0 --config=configs/antmaze_finetune_config.py --eval_episodes=100 --eval_interval=100000 --replay_buffer_size 2000000 ``` -------------------------------- ### Run GAIL with BC Initialization Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Execute GAIL with initialization from a BC checkpoint. This allows GAIL to start with a pre-trained policy from Behavior Cloning. Specify paths for demo data and the BC checkpoint. ```bash # GAIL with BC initialization python -m rolf.main run_prefix=test algo@rolf=gail env.id=Hopper-v2 demo_path=log/Hopper-v2.ppo.test.123/demo/Hopper-v2.ppo.test.123_step_00001000000_100.pkl init_ckpt_path=log/Hopper-v2.bc.test.123/ckpt_00000020.pt init_ckpt_pretrained=True ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Sets up a new conda environment named 'vip' with Python 3.9 and activates it for package installation. ```bash conda create --name vip python=3.9 conda activate vip ``` -------------------------------- ### Install PyTorch with CUDA 11.3 Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Install a specific version of PyTorch (1.10.2) compatible with CUDA 11.3. This command specifies the PyTorch, torchvision, and torchaudio versions. ```bash # PyTorch 1.10.2, Linux, CUDA 11.3 $ pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html ``` -------------------------------- ### Install MuJoCo 2.1.0 and 2.1.1 Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Download and extract MuJoCo versions 2.1.0 and 2.1.1. Ensure the correct versions are placed in the ~/.mujoco directory and the LD_LIBRARY_PATH is updated for MuJoCo 2.1.0. ```bash # download MuJoCo 2.1.0 for mujoco-py $ mkdir ~/.mujoco $ wget https://github.com/deepmind/mujoco/releases/download/2.1.0/mujoco210-linux-x86_64.tar.gz -O mujoco210_linux.tar.gz $ tar -xvzf mujoco210_linux.tar.gz -C ~/.mujoco/ $ rm mujoco210_linux.tar.gz # download MuJoCo 2.1.1 for dm_control $ wget https://github.com/deepmind/mujoco/releases/download/2.1.1/mujoco-2.1.1-linux-x86_64.tar.gz -O mujoco211_linux.tar.gz $ tar -xvzf mujoco211_linux.tar.gz -C ~/.mujoco/ $ rm mujoco211_linux.tar.gz # add MuJoCo 2.1.0 to LD_LIBRARY_PATH $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco210/bin # for GPU rendering $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia ``` -------------------------------- ### Generate Embedding Distance Curves Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Navigates to the examples directory and runs a script to generate embedding distance curves. This script produces plots in the 'embedding_curves' subdirectory. ```bash cd vip/examples python plot_reward_curves.py ``` -------------------------------- ### Run Training for Kitchen and Adroit Environments Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Executes the training script for Kitchen and Adroit environments. Requires the environment name and its corresponding configuration file. ```bash python train_offline.py --env_name=pen-human-v0 --config=configs/kitchen_config.py ``` -------------------------------- ### Run PPO Algorithm Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Use this command to run the Proximal Policy Optimization (PPO) algorithm. Specify the run prefix, algorithm, and environment ID. ```bash python -m rolf.main run_prefix=test algo@rolf=ppo env.id=Hopper-v2 ``` -------------------------------- ### Train VIP on Custom Video Dataset Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Initiates VIP training on a custom video dataset. Specify the dataset name and path using the provided arguments. ```bash python train_vip.py --config-name=config_vip dataset=my_dataset_name datapath=my_dataset_path ``` -------------------------------- ### Run Training for AntMaze Environments Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Initiates training for AntMaze environments. Allows for custom evaluation episodes and intervals. Requires specifying the environment name and configuration. ```bash python train_offline.py --env_name=antmaze-large-play-v0 --config=configs/antmaze_config.py --eval_episodes=100 --eval_interval=100000 ``` -------------------------------- ### Run Behavior Cloning (BC) Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Execute the Behavior Cloning algorithm using the collected expert trajectories. Specify the run prefix, algorithm, environment ID, and the path to the demonstration data. ```bash python -m rolf.main run_prefix=test algo@rolf=bc env.id=Hopper-v2 demo_path=log/Hopper-v2.ppo.test.123/demo/Hopper-v2.ppo.test.123_step_00001000000_100.pkl ``` -------------------------------- ### Run GAIL Algorithm Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Use this command to run the Generative Adversarial Imitation Learning (GAIL) algorithm. Specify the run prefix, algorithm, environment ID, and the path to the demonstration data. ```bash python -m rolf.main run_prefix=test algo@rolf=gail env.id=Hopper-v2 demo_path=log/Hopper-v2.ppo.test.123/demo/Hopper-v2.ppo.test.123_step_00001000000_100.pkl ``` -------------------------------- ### Train VIP on Ego4D Dataset Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Trains VIP using the 'config_vip_ego4d.yaml' configuration, suitable for large-scale pre-training on the Ego4D dataset. Provide the path to your Ego4D dataset. ```bash python train_vip.py --config-name=config_vip_ego4d dataset=ego4d datapath=ego4d_dataset_path ``` -------------------------------- ### Integrate VIP with TorchRL Environment Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Applies the VIPTransform to a TorchRL environment to use VIP as an out-of-box visual representation. Ensure 'my_env' is an existing environment and 'next_pixels' is the key for pixel observations. ```python from torchrl.envs.transforms import VIPTransform env = TransformedEnv(my_env, VIPTransform(keys_in=["next_pixels"], download=True)) ``` -------------------------------- ### Run DDPG Algorithm Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Use this command to run the Deep Deterministic Policy Gradient (DDPG) algorithm. Specify the run prefix, algorithm, and environment ID. ```bash python -m rolf.main run_prefix=test algo@rolf=ddpg env.id=Hopper-v2 ``` -------------------------------- ### Run TD3 Algorithm Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Use this command to run the Twin Delayed Deep Deterministic Policy Gradient (TD3) algorithm. Specify the run prefix, algorithm, and environment ID. ```bash python -m rolf.main run_prefix=test algo@rolf=td3 env.id=Hopper-v2 ``` -------------------------------- ### Run SAC Algorithm Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md Use this command to run the Soft Actor-Critic (SAC) algorithm. Specify the run prefix, algorithm, and environment ID. ```bash python -m rolf.main run_prefix=test algo@rolf=sac env.id=Hopper-v2 ``` -------------------------------- ### Collect Expert Trajectories for BC Source: https://github.com/clvrai/furniture-bench/blob/main/rolf/README.md First, train a PPO expert agent. Then, collect expert trajectories using the trained policy. These trajectories are stored for use in Behavior Cloning. ```bash # train ppo expert agent python -m rolf.main run_prefix=test algo@rolf=ppo env.id=Hopper-v2 # collect expert trajectories using ppo expert policy python -m rolf.main run_prefix=test algo@rolf=ppo env.id=Hopper-v2 is_train=False record_video=False record_demo=True num_eval=100 ``` -------------------------------- ### Load Pre-trained VIP Model Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Loads the VIP model pre-trained on Ego4D and sets it to evaluation mode. ```python from vip import load_vip vip = load_vip() vip.eval() ``` -------------------------------- ### Train R3M Representation Source: https://github.com/clvrai/furniture-bench/blob/main/r3m/README.md Command to train the R3M representation using the Ego4D dataset. Requires specifying data paths and Weights & Biases project details. ```bash python train_representation.py hydra/launcher=local hydra/output=local agent.langweight=1.0 agent.size=50 experiment=r3m_test dataset=ego4d doaug=rctraj agent.l1weight=0.00001 batch_size=16 datapath= wandbuser= wandbproject= ``` -------------------------------- ### Load R3M Model Source: https://github.com/clvrai/furniture-bench/blob/main/r3m/README.md Load a pre-trained R3M model for use in your code. Supports different model sizes like resnet50 and resnet18. ```python from r3m import load_r3m r3m = load_r3m("resnet50") # resnet18, resnet34 r3m.eval() ``` -------------------------------- ### Add Nosetests for Testing Source: https://github.com/clvrai/furniture-bench/blob/main/furniture_bench/assets/franka_description_ros/franka_description/CMakeLists.txt Conditionally adds Python nosetests for robot URDF files if testing is enabled in catkin. ```cmake if(CATKIN_ENABLE_TESTING) catkin_add_nosetests(test/franka_robot_urdf.py) catkin_add_nosetests(test/hand_urdf.py) catkin_add_nosetests(test/dual_panda_example_urdf.py) endif() ``` -------------------------------- ### Comment out NaN/Inf checks in Gym Source: https://github.com/clvrai/furniture-bench/blob/main/implicit_q_learning/README.md Modifies the `passive_env_checker.py` file to comment out checks for NaN and infinity values in observations. This is a workaround for specific environment issues. ```python # if np.any(np.isnan(obs)): # logger.warn("Encountered NaN value in observations.") # if np.any(np.isinf(obs)): # logger.warn("Encountered inf value in observations.") ``` -------------------------------- ### FurnitureBench Citation Source: https://github.com/clvrai/furniture-bench/blob/main/README.md Use this BibTeX entry to cite the FurnitureBench paper in your research. ```bibtex @inproceedings{heo2023furniturebench, title={FurnitureBench: Reproducible Real-World Benchmark for Long-Horizon Complex Manipulation}, author={Minho Heo and Youngwoon Lee and Doohyun Lee and Joseph J. Lim}, booktitle={Robotics: Science and Systems}, year={2023} } ``` -------------------------------- ### VIP Citation Source: https://github.com/clvrai/furniture-bench/blob/main/vip/README.md Provides the BibTeX entry for citing the VIP paper in academic research. ```bibtex @article{ma2022vip, title={VIP: Towards Universal Visual Reward and Representation via Value-Implicit Pre-Training}, author={Ma, Yecheng Jason and Sodhani, Shagun and Jayaraman, Dinesh and Bastani, Osbert and Kumar, Vikash and Zhang, Amy}, journal={arXiv preprint arXiv:2210.00030}, year={2022} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.