Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ dmypy.json

# vscode
.vscode/

results*
82 changes: 82 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Use an official CUDA image as the base
FROM nvidia/cuda:11.8.0-base-ubuntu18.04

# Set environment variables
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PYTHONUNBUFFERED=1 \
PATH=/opt/conda/bin:$PATH

# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
python3.8 \
python3.8-dev \
libgl1-mesa-glx \
libgl1-mesa-dev \
wget \
git && \
rm -rf /var/lib/apt/lists/*

# Install Miniconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && \
rm Miniconda3-latest-Linux-x86_64.sh && \
/opt/conda/bin/conda clean -afy

# Create a working directory
WORKDIR /workspace

# Install MuJoCo dependencies
RUN apt-get update -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
git \
libgl1-mesa-dev \
libgl1-mesa-glx \
libglew-dev \
libosmesa6-dev \
software-properties-common \
net-tools \
vim \
virtualenv \
wget \
xpra \
xserver-xorg-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -o /usr/local/bin/patchelf https://s3-us-west-2.amazonaws.com/openai-sci-artifacts/manual-builds/patchelf_0.9_amd64.elf \
&& chmod +x /usr/local/bin/patchelf

ENV LANG C.UTF-8

RUN mkdir -p /root/.mujoco \
&& wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz \
&& tar -xf mujoco.tar.gz -C /root/.mujoco \
&& rm mujoco.tar.gz

ENV LD_LIBRARY_PATH /root/.mujoco/mujoco210/bin:${LD_LIBRARY_PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib64:${LD_LIBRARY_PATH}

# Copy environment.yml and install dependencies using conda
COPY environment.yml /workspace/
RUN conda env create -f environment.yml && \
conda clean -afy

# Set up CUDA paths for PyTorch
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH \
CUDA_HOME=/usr/local/cuda

RUN conda init bash && \
echo "conda activate pgmorl" >> ~/.bashrc

RUN conda init && . ~/.bashrc && conda activate pgmorl && conda remove --force ffmpeg -y
RUN conda init && . ~/.bashrc && conda activate pgmorl && pip install opencv-python-headless opencv-contrib-python
RUN apt update && apt install -y ffmpeg \
libosmesa6-dev libgl1-mesa-glx libglfw3 \
xvfb
RUN export MUJOCO_GL=egl
RUN conda init && . ~/.bashrc && conda activate pgmorl && python -c "import gym; gym.make('HalfCheetah-v2')"
# Default command to run in the container
CMD ["bash"]
76 changes: 38 additions & 38 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,46 +62,46 @@ dependencies:
- six=1.14.0
- sqlite=3.31.1
- tk=8.6.8
- torchvision=0.5.0
- torchvision
- wheel=0.34.2
- xz=5.2.4
- zlib=1.2.11
- zstd=1.3.7
- pip:
- backcall==0.2.0
- cffi==1.14.0
- cloudpickle==1.2.2
- cycler==0.10.0
- cython==0.29.15
- decorator==4.4.2
- fasteners==0.15
- future==0.18.2
- glfw==1.10.1
- gym==0.15.3
- imageio==2.6.1
- ipython==7.15.0
- ipython-genutils==0.2.0
- jedi==0.17.0
- joblib==0.14.1
- kiwisolver==1.1.0
- matplotlib==3.1.3
- monotonic==1.5
- mujoco-py==2.0.2.9
- parso==0.7.0
- pexpect==4.8.0
- pickleshare==0.7.5
- prompt-toolkit==3.0.5
- protobuf==3.11.3
- ptyprocess==0.6.0
- pycparser==2.19
- pyglet==1.4.10
- pygments==2.6.1
- pyparsing==2.4.6
- python-dateutil==2.8.1
- pyyaml==5.3
- scikit-learn==0.22.1
- scipy==1.4.1
- sklearn==0.0
- tensorboardx==2.0
- traitlets==4.3.3
- wcwidth==0.2.4
- backcall==0.2.0
- cffi==1.14.0
- cloudpickle==1.2.2
- cycler==0.10.0
- cython==0.29.15
- decorator==4.4.2
- fasteners==0.15
- future==0.18.2
- glfw==1.10.1
- gym==0.15.3
- imageio==2.6.1
- ipython==7.15.0
- ipython-genutils==0.2.0
- jedi==0.17.0
- joblib==0.14.1
- kiwisolver==1.1.0
- matplotlib==3.1.3
- monotonic==1.5
- mujoco-py==2.1.*
- parso==0.7.0
- pexpect==4.8.0
- pickleshare==0.7.5
- prompt-toolkit==3.0.5
- protobuf==3.11.3
- ptyprocess==0.6.0
- pycparser==2.19
- pyglet==1.4.10
- pygments==2.6.1
- pyparsing==2.4.6
- python-dateutil==2.8.1
- pyyaml==5.3
- scikit-learn==0.22.1
- scipy==1.4.1
- sklearn==0.0
- tensorboardx==2.0
- traitlets==4.3.3
- wcwidth==0.2.4
1 change: 0 additions & 1 deletion environments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@
entry_point = 'environments.humanoid:HumanoidEnv',
max_episode_steps=1000,
)

2 changes: 1 addition & 1 deletion environments/half_cheetah.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def reset_model(self):
return self._get_obs()

def viewer_setup(self):
self.viewer.cam.distance = self.model.stat.extent * 0.5
self.viewer.cam.distance = self.model.stat.extent * 0.5
1 change: 0 additions & 1 deletion scripts/plot/mujoco_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,3 @@

env.close()