/multiddpg

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Instructions for Installation

  1. This codebase is tested with Ubuntu 20.04.6 LTS, CUDA Version: 12.0, Cuda compilation tools, release 11.8, V11.8.89 and Nvidia driver version 525.125.06.

The following command will install some necessary dependencies.

sudo apt-get install build-essential libgl1-mesa-dev freeglut3-dev libglfw3 libgles2-mesa-dev
  1. Create conda environment Create a conda environment and activate it: conda env create -f environment.yml

  2. Using Docker to compile PyFlex.

We posted the Dockerfile. To generate the pre-built file, download the Dockerfile in this directory and run

docker build -t multiddpg .

in the directory that contains the Dockerfile.

Using the following command to run docker

  nvidia-docker run \
  -v PATH_TO_MultiDDPG:/workspace/multiddpg \
  -v PATH_TO_CONDA:PATH_TO_CONDA \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  --gpus all \
  -e DISPLAY=$DISPLAY \
  -e QT_X11_NO_MITSHM=1 \
  -it multiddpg bash

Now you are in the Docker environment. Go to the multiddpg directory and compile PyFlex

export PATH="PATH_TO_CONDA/bin:$PATH"
. ./prepare_1.0.sh && ./compile_1.0.sh

install softgym

cd softgym
pip install .
  1. Go to the root folder of MultiDDPG and run . ./prepare_1.0.sh && ./compile_1.0.sh. Please see the example test scripts and the bottom of bindings/pyflex.cpp for available APIs.

MultiDDPG Train and Test

Test MultiDDPG for 10 tasks with different inital positions using the network in './model'


python examples/script.py --train 0

Train MultiDDPG for 50 episodes as an example stores in './model'


python examples/script.py --train 1

If the module 'softgym' can not be found. Please change the sys path in '.\examples\ddpg_env.py' and '.\exaples\ddpg_test.py'

References