-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1292795
commit d0dd329
Showing
13 changed files
with
368 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Ignore everything. | ||
** | ||
|
||
# Allow `/src` and `Dockerfile`. | ||
!/Dockerfile | ||
!/src/** | ||
|
||
!/runner.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
FROM tensorflow/tensorflow:1.15.2-py3 | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install automake autotools-dev fuse g++ git libcurl4-openssl-dev libfuse-dev libssl-dev libxml2-dev make pkg-config \ | ||
&& apt-get -y install s3fs \ | ||
&& apt-get -y install python-scipy | ||
|
||
RUN pip install \ | ||
absl-py==0.7.1 \ | ||
alabaster==0.7.12 \ | ||
appdirs==1.4.3 \ | ||
astor==0.7.1 \ | ||
Babel==2.8.0 \ | ||
certifi==2019.9.11 \ | ||
chardet==3.0.4 \ | ||
cloudpickle==1.2.2 \ | ||
decorator==4.4.1 \ | ||
docutils==0.16 \ | ||
gast==0.2.2 \ | ||
google-pasta==0.1.6 \ | ||
# graphsurgeon==0.4.1 \ | ||
grpcio==1.16.1 \ | ||
h5py==2.9.0 \ | ||
# hpo==0.3.1 \ | ||
idna==2.9 \ | ||
imagesize==1.2.0 \ | ||
Jinja2==2.11.1 \ | ||
joblib==0.14.1 \ | ||
Keras==2.2.5 \ | ||
Keras-Applications==1.0.8 \ | ||
Keras-Preprocessing==1.1.0 \ | ||
Markdown==3.1.1 \ | ||
MarkupSafe==1.1.1 \ | ||
# mkl-fft==1.0.15 \ | ||
# mkl-random==1.1.0 \ | ||
# mkl-service==2.3.0 \ | ||
mock==4.0.1 \ | ||
nose==1.3.7 \ | ||
numpy==1.16.5 \ | ||
numpydoc==0.9.2 \ | ||
olefile==0.46 \ | ||
packaging==20.1 \ | ||
pandas==1.0.1 \ | ||
Pillow==6.2.1 \ | ||
ply==3.11 \ | ||
protobuf==3.8.0 \ | ||
psutil==5.5.0 \ | ||
Pygments==2.5.2 \ | ||
Pyomo==5.2 \ | ||
pyparsing==2.4.6 \ | ||
python-dateutil==2.8.1 \ | ||
pytz==2019.3 \ | ||
PyUtilib==5.7.3 \ | ||
PyYAML==5.1.2 \ | ||
# rbfopt==0.2 \ | ||
requests==2.23.0 \ | ||
scikit-learn==0.22.2.post1 \ | ||
# scipy==1.3.1 \ | ||
six==1.12.0 \ | ||
sklearn==0.0 \ | ||
snowballstemmer==2.0.0 \ | ||
Sphinx==2.4.3 \ | ||
sphinxcontrib-applehelp==1.0.2 \ | ||
sphinxcontrib-devhelp==1.0.2 \ | ||
sphinxcontrib-htmlhelp==1.0.3 \ | ||
sphinxcontrib-jsmath==1.0.1 \ | ||
sphinxcontrib-qthelp==1.0.3 \ | ||
sphinxcontrib-serializinghtml==1.1.4 \ | ||
# tensorboard==1.15.0 \ | ||
# tensorflow==1.15.0 \ | ||
# tensorflow-estimator==1.15.1 \ | ||
# tensorflow-probability==0.8.0 \ | ||
# tensorflow-serving-api==1.15.0 \ | ||
# tensorrt==6.0.1.5 \ | ||
termcolor==1.1.0 \ | ||
# tflms==2.0.2 \ | ||
# uff==0.6.5 \ | ||
urllib3==1.25.8 \ | ||
Werkzeug==0.15.4 \ | ||
wrapt==1.11.2 | ||
|
||
ADD src / | ||
ADD runner.sh . | ||
|
||
RUN chmod +x start.sh | ||
RUN chmod +x runner.sh | ||
|
||
ENTRYPOINT ["./runner.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Build the docker image: | ||
``` | ||
docker build -t trainer . | ||
``` | ||
|
||
Run with number of steps: | ||
``` | ||
docker build -t trainer . && docker run -a stdin -a stdout -a stderr -i -t --privileged trainer 10 | ||
``` | ||
|
||
``` | ||
zip -r trainer.zip src | ||
cacli train thumbs-up-down-v2 --steps 500 --script trainer.zip --frameworkv 1.15 | ||
``` | ||
|
||
coremltools==3.3 | ||
tfcoreml==1.1 | ||
tensorflowjs==1.4.0 | ||
``` | ||
python -m convert.convert --tfjs --coreml --tflite \ | ||
--tfjs-path=../model_web \ | ||
--mlmodel-path=../model_ios \ | ||
--tflite-path=../model_android \ | ||
--saved-model-path=../model | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source .env | ||
|
||
BUCKET=$1 | ||
STEPS=$2 | ||
|
||
docker build -t trainer . | ||
docker run -a stdin -a stdout -a stderr -i -t --privileged trainer $S3_ID $S3_KEY $BUCKET $STEPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
mkdir data_dir | ||
mkdir result_dir | ||
|
||
S3_ID=$1 | ||
S3_KEY=$2 | ||
BUCKET=$3 | ||
STEPS=$4 | ||
|
||
echo $S3_ID:$S3_KEY > .passwd-s3fs | ||
chmod 600 .passwd-s3fs | ||
s3fs $BUCKET /data_dir -o passwd_file=.passwd-s3fs -o url=https://s3.us.cloud-object-storage.appdomain.cloud/ -o use_path_request_style | ||
s3fs $BUCKET /result_dir -o passwd_file=.passwd-s3fs -o url=https://s3.us.cloud-object-storage.appdomain.cloud/ -o use_path_request_style | ||
|
||
export DATA_DIR=/data_dir | ||
export RESULT_DIR=/result_dir/training-local-$(cat /dev/urandom | tr -cd '\-_a-zA-Z0-9' | head -c 9) | ||
|
||
mkdir $RESULT_DIR | ||
|
||
./start.sh $STEPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.