diff --git a/docs/source/flow_setup.rst b/docs/source/flow_setup.rst index 42a70fba9..1fc9bb0a6 100644 --- a/docs/source/flow_setup.rst +++ b/docs/source/flow_setup.rst @@ -14,8 +14,11 @@ shell commands below to get started. Dependencies ============ We begin by installing dependencies needed by the four repositories mentioned -above. It will be useful to install `Anaconda `_ -for Python. +above. **It is highly recommended that users install +`Anaconda `_ or +`Miniconda `_ +for Python and the setup instructions will assume that you are +doing so.** For Ubuntu 16.04: :: @@ -38,6 +41,7 @@ sumo Next, we install SUMO, an open source traffic microsimulator which will be used the update the states of vehicles, traffic lights, and other RL and human-driven agents during the simulation process. + :: cd ~ @@ -47,12 +51,22 @@ human-driven agents during the simulation process. make -f Makefile.cvs If you have OSX, run the following commands + :: + export CPPFLAGS=-I/opt/X11/include export LDFLAGS=-L/opt/X11/lib + ./configure CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=gnu++11" --with-xerces=/usr/local --with-proj-gdal=/usr/local + make -j$nproc + echo 'export SUMO_HOME="$HOME/sumo"' >> ~/.bash_profile + echo 'export PATH="$HOME/sumo/bin:$PATH"' >> ~/.bash_profile + echo 'export PYTHONPATH="$HOME/sumo/tools:$PYTHONPATH"' >> ~/.bash_profile + source ~/.bashprofile + +If you have Ubuntu 14.04+, run the following command -Now for both OSX and linux run the following command :: + ./configure make -j$nproc echo 'export SUMO_HOME="$HOME/sumo"' >> ~/.bashrc @@ -60,8 +74,10 @@ Now for both OSX and linux run the following command echo 'export PYTHONPATH="$HOME/sumo/tools:$PYTHONPATH"' >> ~/.bashrc source ~/.bashrc -Test your sumo install and version by running the following commands +Finally, test your sumo install and version by running the following commands + :: + which sumo sumo --version sumo-gui @@ -79,10 +95,19 @@ Ray/RLlib for more). cd ~ git clone https://github.com/flow-project/flow.git cd flow + conda env create -f environment.yml + source activate flow python3 setup.py develop + +For linux run +:: echo 'export PYTHONPATH="$HOME/flow:$PYTHONPATH"' >> ~/.bashrc source ~/.bashrc +For mac run +:: + echo 'export PYTHONPATH="$HOME/flow:$PYTHONPATH"' >> ~/.bash_profile + source ~/.bash_profile Testing the Installation ======================== @@ -121,9 +146,17 @@ to install the `rllab-multiagent` library, follow the below instructions cd rllab-multiagent conda env create -f environment.yml python3 setup.py develop + +For linux run +:: echo 'export PYTHONPATH="$HOME/rllab-multiagent:$PYTHONPATH"' >> ~/.bashrc source ~/.bashrc +For mac run +:: + echo 'export PYTHONPATH="$HOME/rllab-multiagent:$PYTHONPATH"' >> ~/.bash_profile + source ~/.bash_profile + Ray/RLlib (optional) ==================== RLlib is another RL library that has been extensively tested on the Flow @@ -150,7 +183,7 @@ Getting started (rllab-multiagent) To run any of the RL examples, make sure to run :: - source activate flow-rllab + source activate flow In order to test run an Flow experiment in rllab-multiagent, try the following command: @@ -167,6 +200,11 @@ Getting started (Ray/RLlib) See `getting started with RLlib `_ for sample commands. +To run any of the RL examples, make sure to run +:: + + source activate flow + In order to test run an Flow experiment in RLlib, try the following command: :: diff --git a/environment.yml b/environment.yml new file mode 100644 index 000000000..5d598f321 --- /dev/null +++ b/environment.yml @@ -0,0 +1,62 @@ +name: flow +channels: + - https://conda.anaconda.org/kne +# - https://conda.anaconda.org/tlatorre + - https://conda.anaconda.org/cjs14 + - https://conda.anaconda.org/menpo + - jjhelmus + - soumith +dependencies: + - python==3.5.2 + - numpy==1.13.3 + - scipy==1.1.0 + - path.py + - python-dateutil + - joblib==0.10.3 + - mako==1.0.7 + - ipywidgets==5.1.5 + - numba==0.38.1 + - flask==1.0.2 + - pybox2d==2.3.1post2 + - pygame==1.9.2a0 + - h5py==2.8.0 + - matplotlib==2.2.2 + - opencv3=3.1.0 + - scikit-learn==0.19.1 + - mpi4py==2.0.0 + - pandas==0.23.4 + - pip: + - Pillow==4.2.1 + - pyprind==2.11.2 + - boto3==1.7.73 + - PyOpenGL==3.1.0 + - nose2==0.8.0 + - pyzmq==17.1.0 + - tqdm==4.24.0 + - msgpack-python==0.5.6 + - cached_property==1.4.3 + - line_profiler==2.1.2 + - cloudpickle==0.5.3 + - Cython==0.28.5 + - redis==2.10.6 + - keras==1.2.1 + - git+https://github.com/Theano/Theano.git@adfe319ce6b781083d8dc3200fb4481b00853791#egg=Theano + - git+https://github.com/neocxi/Lasagne.git@484866cf8b38d878e92d521be445968531646bb8#egg=Lasagne + - git+https://github.com/plotly/plotly.py.git@2594076e29584ede2d09f2aa40a8a195b3f3fc66#egg=plotly + - awscli==1.15.74 + - gym==0.10.5 + - pyglet==1.3.2 + - git+https://github.com/neocxi/prettytensor.git + - jupyter==1.0.0 + - progressbar2==3.38.0 + - chainer==1.18.0 + - tensorflow==1.10.0 + - numpy-stl==2.2.0 + - nibabel==2.1.0 + - pylru==1.0.9 + - hyperopt==0.1 + - polling==0.3.0 + - lxml==4.2.4 + # RLLIB installs + - six==1.11.0 + - redis==2.10.6 diff --git a/examples/rllab/stabilizing_the_ring.py b/examples/rllab/stabilizing_the_ring.py index 71d7c335c..8ada31b65 100644 --- a/examples/rllab/stabilizing_the_ring.py +++ b/examples/rllab/stabilizing_the_ring.py @@ -19,7 +19,7 @@ def run_task(*_): - sumo_params = SumoParams(sim_step=0.1, sumo_binary="sumo-gui", seed=0) + sumo_params = SumoParams(sim_step=0.1, sumo_binary="sumo", seed=0) vehicles = Vehicles() vehicles.add(veh_id="rl", diff --git a/requirements.txt b/requirements.txt index fd48d479e..f5333222d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,15 @@ gym==0.10.5 -numpy==1.14.5 +numpy==1.13.3 scipy==1.1.0 lxml==4.2.4 # theano==0.8.2 # for rllab pyprind==2.11.2 # lasagne # for rllab -tensorflow==1.10.0 +tensorflow==1.8.0 nose2==0.8.0 six>=1.1 path.py joblib==0.10.3 python-dateutil==2.7.3 cached_property +