GitXplorerGitXplorer
j

snerl_official

public
27 stars
6 forks
2 issues

Commits

List of commits on branch main.
Unverified
d01533b673ebcea1705b15d5e4549c67c757d9a9

Merge branch 'main' of https://github.com/jayLEE0301/snerl_official into main

jjayLEE0301 committed a year ago
Unverified
d24d3231cab8dfb65884cbea74942bf0d9b1faa4

downstream rl issue fixed: add .png files

jjayLEE0301 committed a year ago
Verified
1b6d5eceaa8c849de302004bc15ec7f3597f3f34

Update README.md

jjayLEE0301 committed a year ago
Verified
7eadf08f73fefaa89dac33da62a4e052c2486d13

Update README.md

ddsshim0125 committed 2 years ago
Verified
0c8b8a841465803f16f410c704a4bb0ab6fe980d

Update README.md

ddsshim0125 committed 2 years ago
Unverified
c7b2cbf80690a6e525437ec89621d25e8c4006d4

first commit

jjayLEE0301 committed 2 years ago

README

The README file for this repository.

SNeRL

This is the official PyTorch implementation of the paper "SNeRL: Semantic-aware Neural Radiance Fields for Reinforcement Learning" (ICML 2023). [paper]

Dataset

We provide dataset for two environments (Drawer, Soccer).

Drawer

Soccer

Setup Instructions

  1. Create a conda environment:
conda create -n snerl python=3.9
conda activate snerl
  1. Install MuJoCo and task environments:
cd metaworld
pip install -e .
cd ..
  1. install pytorch (use tested on pytorch 1.12.1 with CUDA 11.3)

  2. install additional dependencies:

pip install scikit-image
pip install tensorboard
pip install termcolor
pip install imageio
pip install imageio-ffmpeg
pip install opencv-python
pip install matplotlib
pip isntall tqdm
pip install timm
pip install configargparse

Usage

Our code does not include the dataset generator for nerf pretraining. Please prepare your dataset for nerf pretraining.

Pretrain Encoder

cd nerf_pretrain
python run_nerf.py --config configs/{env_name}.txt

Train Donstream RL

  1. Locate pretained model in './encoder_pretrained/{env_name}/snerl.tar'

  2. Use the following commands to train RL agents:

window-open-v2

CUDA_VISIBLE_DEVICES=0 python snerl/train.py --env_name window-open-v2 --encoder_type nerf --save_tb --frame_stack 2 --eval_freq 10000 --batch_size 128 --save_video --save_model --image_size 128 --camera_name cam_1_1 cam_7_4 cam_14_2 --multiview 3 --encoder_name 'snerl' --seed 1

drawer-open-v2

CUDA_VISIBLE_DEVICES=0 python snerl/train.py --env_name drawer-open-v2 --encoder_type nerf --save_tb --frame_stack 2 --eval_freq 10000 --batch_size 128 --save_video --save_model --image_size 128 --camera_name cam_1_1 cam_7_4 cam_14_2 --multiview 3 --encoder_name 'snerl' --seed 1

hammer-v2

CUDA_VISIBLE_DEVICES=0 python snerl/train.py --env_name hammer-v2 --encoder_type nerf --save_tb --frame_stack 2 --eval_freq 10000 --batch_size 128 --save_video --save_model --image_size 128 --camera_name cam_1_1 cam_7_4 cam_14_2 --multiview 3 --encoder_name 'snerl' --seed 1

soccer-v2

CUDA_VISIBLE_DEVICES=0 python snerl/train.py --env_name soccer-v2 --encoder_type nerf --save_tb --frame_stack 2 --eval_freq 10000 --batch_size 128 --save_video --save_model --image_size 128 --camera_name cam_1_1 cam_7_4 cam_14_2 --multiview 3 --encoder_name 'snerl' --seed 1

Reference

Our code sourced and modified from official implementation of CURL and NeRF.

Citation

If you use this repo in your research, please consider citing the paper as follows.

@inproceedings{shim2023snerl,
  title={SNeRL: Semantic-aware Neural Radiance Fields for Reinforcement Learning},
  author={Shim, Dongseok and Lee, Seungjae and Kim, H Jin},
  booktitle=International Conference on Machine Learning},
  pages={},
  year={2023},
  organization={PMLR}
}