Skip to content

Instantly share code, notes, and snippets.

@kretes
Last active November 15, 2016 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kretes/44734faaac63a04c8214976292aff2d6 to your computer and use it in GitHub Desktop.
Save kretes/44734faaac63a04c8214976292aff2d6 to your computer and use it in GitHub Desktop.
This is a minimal docker file to run quiver https://github.com/jakebian/quiver
FROM continuumio/miniconda
RUN pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
RUN pip install h5py
RUN apt-get install -y git
RUN git clone https://github.com/jakebian/quiver.git
RUN apt-get install -y libjpeg62-turbo-dev gcc
RUN pip install keras flask flask_cors gevent numpy pillow
RUN cd quiver && python setup.py develop
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
model = Sequential()
model.add(Convolution2D(32, 3, 3, input_shape=(32,32,3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(64))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(1))
model.add(Activation('sigmoid'))
model.compile(loss='binary_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
print(model.summary())
from quiver_engine import server
server.launch(model)
docker build -t quiver:try6 . && docker run -it -p 5000:5000 -v `pwd`:/tmp quiver:try6 python /tmp/run.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment