Skip to content

Commit

Permalink
been a while
Browse files Browse the repository at this point in the history
  • Loading branch information
tribhi committed Apr 16, 2024
1 parent 144ad4b commit 66ce61a
Show file tree
Hide file tree
Showing 9 changed files with 6,929 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .bash_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ls
python test_traj.py
source /opt/ros/kinetic/setup.bash
python test_traj.py
ls
pwd
ls
cd data/test_irl/demo_0/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
.ipynb_checkpoints/
__pycache__/
data/
exp/
exp/
.ros/
.python_history
.visdom
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM pytorch/pytorch:0.4.1-cuda9-cudnn7-devel
ENV TZ=US/Michigan
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y \
git \
x11-apps \
mesa-utils \
libgl1-mesa-glx \
apt-utils \
python \
wget \
lsb-release \
git

RUN apt-get update && apt-get -y install rsync

RUN pip install cython numpy==1.15.4
RUN pip install numba==0.50.1 matplotlib==2.1.2
RUN pip install scipy==1.0.0 seaborn==0.9.0
RUN pip install tqdm==4.19.4 visdom==0.1.8.3
RUN pip install matplotlib
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64"

RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -


RUN apt-get update && apt-get install -y \
python-tk \
ros-kinetic-desktop-full \
ros-kinetic-move-base \
ros-kinetic-tf2-sensor-msgs \
python-rosdep \
python-rosinstall \
python-rosinstall-generator \
build-essential

RUN rosdep init && rosdep update
WORKDIR /root/catkin_ws
RUN pip install rospkg
# RUN catkin_make
RUN echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
ENV ROS_MASTER_URI=http://172.17.0.1:11311
ENV ROS_IP=172.17.0.1
ENV DISPLAY=unix$DISPLAY
32 changes: 32 additions & 0 deletions launch_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
container_name=$1
xhost +local:
XAUTH=/home/tribhi/.docker.xauth
touch $XAUTH
if [ ! -f $XAUTH ]
then
xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/')
if [ ! -z "$xauth_list" ]
then
echo $xauth_list | xauth -f $XAUTH nmerge -
else
touch $XAUTH
fi
chmod a+r $XAUTH
fi

docker run -it --net=host\
--user=$(id -u) \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--env="USER=$USER" \
--workdir=/home/$USER/ \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--volume="${PWD}:/home/$USER" \
--env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
-v "/etc/passwd:/etc/passwd:rw" \
--gpus all \
--runtime nvidia \
--security-opt seccomp=unconfined \
--name=${container_name} \
vehmedirl:ros
2 changes: 1 addition & 1 deletion loader/data_loader_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def is_valid_traj(traj):
return True

class OffroadLoader(Dataset):
def __init__(self, grid_size, train=True, demo=None, datadir='/root/medirl/data/irl_jan_12', pre_train=False, tangent=False,
def __init__(self, grid_size, train=True, demo=None, datadir='/root/medirl/data/irl_feb_6', pre_train=False, tangent=False,
more_kinematic=None, human = False):
assert grid_size % 2 == 0, "grid size must be even number"
self.grid_size = grid_size
Expand Down
2 changes: 1 addition & 1 deletion loader/data_loader_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_traj_length_unique(traj):


class OffroadLoader(Dataset):
def __init__(self, grid_size, train=True, demo=None, datadir='/root/medirl/data/irl_jan_12/driving', pre_train=False, tangent=False,
def __init__(self, grid_size, train=True, demo=None, datadir='data/irl_feb_6/driving', pre_train=False, tangent=False,
more_kinematic=None, human = False):
assert grid_size % 2 == 0, "grid size must be even number"
self.grid_size = grid_size
Expand Down
2 changes: 1 addition & 1 deletion loader/data_loader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_traj_length_unique(traj):
return np.array(lengths), traj_list

class OffroadLoader(Dataset):
def __init__(self, grid_size, train=True, demo=None, datadir='/root/medirl/data/test_irl', pre_train=False, tangent=False,
def __init__(self, grid_size, train=True, demo=None, datadir='data/test_irl', pre_train=False, tangent=False,
more_kinematic=None, human = False):
assert grid_size % 2 == 0, "grid size must be even number"
self.grid_size = grid_size
Expand Down
6,834 changes: 6,834 additions & 0 deletions maxent_irl_social.log

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions train_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def zeroing_loss(c_zero, zeroing_loss):
grid_size = 32
discount = 0.9
lr = 5e-4
n_epoch = 64
batch_size = 8
n_worker = 8
n_epoch = 128
batch_size = 2
n_worker = 2
use_gpu = True


Expand Down

0 comments on commit 66ce61a

Please sign in to comment.