Saturday, September 8, 2018

Week 0 - Jupyter notebook with Keras and Tensorflow

Starting with my deep-learning learning plan, I wanted to have a good development environment. This meant having a Docker image that can work on any device I am using with no extra setup needed. My choice was to use Keras with Tensorflow core for an easy start with not so many unwanted details at this step. I also chose to use Jupyter notebook to have a nice interface to trace/explain my code along with graphs and output numbers.

The following is my finalized Dockerfile with the latest versions which worked exactly how I wanted it.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# To build the container
# docker build -t jupyter-keras .
# To run the container:
# docker run -it -v /$(pwd)/:/home/jovyan/work -p 8888:8888 jupyter-keras:latest start-notebook.sh --NotebookApp.token=''
 
# To access the notbook from the browser:
 
# To login in to the server:
# docker exec -it <container id=""> /bin/bash
 
# To check Keras version:
# python -c 'import keras; print(keras.__version__)'
 
FROM jupyter/scipy-notebook
 
MAINTAINER Gaarv <@Gaarv1911>
 
USER root
 
# bash instead of dash to use source
RUN ln -snf /bin/bash /bin/sh
 
USER jovyan
 
RUN pip install --upgrade pip \
  && pip install --upgrade tensorflow \
  && pip install --upgrade --no-deps git+git://github.com/keras-team/keras.git \
&& pip install --upgrade --no-deps h5py
</container>

No comments:

Post a Comment