diff --git a/Dockerfile b/Dockerfile index 70cb56f..c5866b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get update -y &&\ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*tmp USER main +ADD requirements.txt /home/main/ RUN /usr/bin/pip2 install --upgrade --user pip wheel RUN /usr/bin/pip3 install --upgrade --user pip wheel @@ -30,18 +31,12 @@ RUN /usr/bin/pip3 install --upgrade --user pip wheel ENV PATH /home/main/.local/bin:$PATH # Install scientific packages -RUN pip2 install --upgrade --user matplotlib numexpr numpy pandas Pillow protobuf psutil scipy scikit-learn sympy jupyter -RUN pip3 install --upgrade --user matplotlib numexpr numpy pandas Pillow protobuf psutil scipy scikit-learn sympy jupyter - -# Install TensorFlow -RUN pip2 install --user --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl -RUN pip3 install --user --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp34-cp34m-linux_x86_64.whl +RUN pip2 install --upgrade --user -r requirements.txt +RUN pip3 install --upgrade --user -r requirements.txt # Install OpenAI gym -RUN pip2 install --user --upgrade gym -RUN pip3 install --user --upgrade gym -RUN pip2 install --user --upgrade 'gym[all]' -RUN pip3 install --user --upgrade 'gym[all]' +RUN pip2 install --upgrade --user 'gym[all]' +RUN pip3 install --upgrade --user 'gym[all]' # Install Jupyter extensions RUN pip3 install --user --upgrade https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master @@ -58,3 +53,9 @@ RUN /usr/bin/python2 -m ipykernel install --user RUN /usr/bin/python3 -m ipykernel install --user ADD .binder_start /home/main/ + +RUN mkdir -p $HOME/.jupyter +RUN echo "c.NotebookApp.token = ''" >> $HOME/.jupyter/jupyter_notebook_config.py +RUN echo "c.NotebookApp.password=''" >> $HOME/.jupyter/jupyter_notebook_config.py +RUN echo "c.NotebookApp.password_required=False" >> $HOME/.jupyter/jupyter_notebook_config.py + diff --git a/README.md b/README.md index 8c7f912..1b51a47 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,7 @@ If you want an isolated environment (recommended), you can use [virtualenv](http $ virtualenv env $ source ./env/bin/activate -There are different packages for TensorFlow, depending on your platform. Please edit `requirements.txt` and make sure only the right one for your platform is uncommented. Default is Python 3.5, Ubuntu/Linux 64-bits, CPU-only. - -Also, if you want to go through chapter 16 on Reinforcement Learning, you will need to [install OpenAI gym](https://gym.openai.com/docs) and its dependencies for Atari simulations. +If you want to go through chapter 16 on Reinforcement Learning, you will need to [install OpenAI gym](https://gym.openai.com/docs) and its dependencies for Atari simulations. Then make sure pip is up to date, and use it to install the required python packages: @@ -45,7 +43,7 @@ Then make sure pip is up to date, and use it to install the required python pack If you prefer to use [Anaconda](https://www.continuum.io/), you can run the following commands instead: - $ conda install -c jjhelmus tensorflow=0.10.0 + $ conda install -c jjhelmus tensorflow=0.12.0rc0 $ conda install -c conda-forge jupyter_contrib_nbextensions If you want to install the Jupyter extensions, run the following command: diff --git a/requirements.txt b/requirements.txt index bcdddcb..6f1841f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,18 +3,18 @@ # # Then you probably want to work in a virtualenv (optional): # $ sudo pip install --upgrade virtualenv -# Or if you prefer, in Ubuntu: +# Or if you prefer you can install virtualenv using your favorite packaging system. E.g., in Ubuntu: # $ sudo apt-get update && sudo apt-get install virtualenv # Then: # $ cd $my_work_dir # $ virtualenv my_env # $ . my_env/bin/activate # -# Next, optionally uncomment the OpenAI gym lines (see below). If you do, make sure to install the dependencies. +# Next, optionally uncomment the OpenAI gym lines (see below). If you do, make sure to install the dependencies first. # -# Then uncomment only the desired version of TensorFlow (see below), and install the requirements: +# Then install these requirements: # $ pip install --upgrade -r requirements.txt -# +# # Finally, start jupyter: # $ jupyter notebook # @@ -22,7 +22,7 @@ jupyter==1.0.0 matplotlib==1.5.3 numexpr==2.6.1 -numpy==1.11.2 +numpy==1.12.0 pandas==0.19.1 Pillow==3.4.2 protobuf==3.0.0 @@ -30,53 +30,15 @@ psutil==5.0.0 scikit-learn==0.18.1 scipy==0.18.1 sympy==1.0 +tensorflow==0.12.1 # Optional: OpenAI gym is only needed for the Reinforcement Learning chapter. # There are a few dependencies you need to install first, check out: # https://github.com/openai/gym#installing-everything -#gym==0.5.4 -#atari-py==0.0.18 +#gym[all]==0.5.4 +# If you only want to install the Atari dependency, uncomment this line instead: +#gym[atari]==0.5.4 # Optional: these are useful Jupyter extensions, in particular to display # the table of contents. https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master - -###### -##### -#### Uncomment only the right version of TensorFlow for your system -### (default is Python 3.5, Ubuntu/Linux 64-bit, CPU only) -## - -# For GPU versions, requires CUDA toolkit 7.5 and CuDNN v5. -# See https://www.tensorflow.org/versions/master/get_started/os_setup.html - -# Ubuntu/Linux 64-bit, CPU only, Python 2.7 -#https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl - -# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 -#https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl - -# Mac OS X, CPU only, Python 2.7: -#https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl - -# Mac OS X, GPU enabled, Python 2.7: -#https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0-py2-none-any.whl - -# Ubuntu/Linux 64-bit, CPU only, Python 3.4 -#https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp34-cp34m-linux_x86_64.whl - -# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 -#https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp34-cp34m-linux_x86_64.whl - -# Ubuntu/Linux 64-bit, CPU only, Python 3.5 -https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp35-cp35m-linux_x86_64.whl - -# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 -#https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp35-cp35m-linux_x86_64.whl - -# Mac OS X, CPU only, Python 3.4 or 3.5: -#https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py3-none-any.whl - -# Mac OS X, GPU enabled, Python 3.4 or 3.5: -#https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0-py3-none-any.whl -