From 57eab4cdb577f144b97a9c63f99c3da8f1ef6e3f Mon Sep 17 00:00:00 2001 From: atqy <95724753+atqy@users.noreply.github.com> Date: Thu, 18 Aug 2022 09:54:10 -0700 Subject: [PATCH 1/3] fix multi_model_catboost.ipynb (#3561) Co-authored-by: EC2 Default User --- .../multi_model_catboost/container/Dockerfile | 2 +- .../multi_model_catboost/multi_model_catboost.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced_functionality/multi_model_catboost/container/Dockerfile b/advanced_functionality/multi_model_catboost/container/Dockerfile index 089390df06..4e05fca116 100644 --- a/advanced_functionality/multi_model_catboost/container/Dockerfile +++ b/advanced_functionality/multi_model_catboost/container/Dockerfile @@ -16,7 +16,7 @@ RUN apt-get update && \ python3 \ vim \ && rm -rf /var/lib/apt/lists/* \ - && curl -O https://bootstrap.pypa.io/pip/3.7/get-pip.py \ + && curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py \ && python3 get-pip.py RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 diff --git a/advanced_functionality/multi_model_catboost/multi_model_catboost.ipynb b/advanced_functionality/multi_model_catboost/multi_model_catboost.ipynb index cc9c7f91a5..233f0966cf 100644 --- a/advanced_functionality/multi_model_catboost/multi_model_catboost.ipynb +++ b/advanced_functionality/multi_model_catboost/multi_model_catboost.ipynb @@ -469,7 +469,7 @@ "metadata": {}, "source": [ "### Invoke just one of models 1000 times \n", - "Since the models will be in memory and loaded, these invocations will not have any latency \n" + "Since the models are in memory and loaded, these invocations should not have any latency \n" ] }, { From dd53fe1a1dbf86a4f3981404bef26641886f367c Mon Sep 17 00:00:00 2001 From: atqy <95724753+atqy@users.noreply.github.com> Date: Thu, 18 Aug 2022 09:54:46 -0700 Subject: [PATCH 2/3] fix scikit_bring_your_own.ipynb (#3552) * fix scikit_bring_your_own.ipynb * debug * debug * debug * debug * cleanup * cleanup * cleanup Co-authored-by: EC2 Default User --- .../container/decision_trees/train | 2 +- .../scikit_bring_your_own/scikit_bring_your_own.ipynb | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/advanced_functionality/scikit_bring_your_own/container/decision_trees/train b/advanced_functionality/scikit_bring_your_own/container/decision_trees/train index 8654139ed8..1be2e1eea6 100755 --- a/advanced_functionality/scikit_bring_your_own/container/decision_trees/train +++ b/advanced_functionality/scikit_bring_your_own/container/decision_trees/train @@ -44,7 +44,7 @@ def train(): 'This usually indicates that the channel ({}) was incorrectly specified,\n' + 'the data specification in S3 was incorrectly specified or the role specified\n' + 'does not have permission to access the data.').format(training_path, channel_name)) - raw_data = [ pd.read_csv(file, header=None) for file in input_files ] + raw_data = [ pd.read_csv(file, header=None) for file in input_files if file.endswith(".csv")] train_data = pd.concat(raw_data) # labels are in the first column diff --git a/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb b/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb index 9fab0f8d5b..d6c046ce83 100644 --- a/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb +++ b/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb @@ -276,7 +276,7 @@ "# Build the docker image locally with the image name and then push it to ECR\n", "# with the full name.\n", "\n", - "docker build -t ${algorithm_name} .\n", + "docker build -t ${algorithm_name} .\n", "docker tag ${algorithm_name} ${fullname}\n", "\n", "docker push ${fullname}" @@ -315,9 +315,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# S3 prefix\n", @@ -347,9 +345,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "import sagemaker as sage\n", From 76bce507c76f2c2d267d7d838e02ad8c5f4e6e7b Mon Sep 17 00:00:00 2001 From: atqy <95724753+atqy@users.noreply.github.com> Date: Thu, 18 Aug 2022 09:55:24 -0700 Subject: [PATCH 3/3] fix tune_r_bring_your_own.ipynb (#3562) --- .../r_bring_your_own/Dockerfile | 26 ++++++++++++++++++- .../tune_r_bring_your_own.ipynb | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hyperparameter_tuning/r_bring_your_own/Dockerfile b/hyperparameter_tuning/r_bring_your_own/Dockerfile index 8f441f5113..5ca1d8798a 100644 --- a/hyperparameter_tuning/r_bring_your_own/Dockerfile +++ b/hyperparameter_tuning/r_bring_your_own/Dockerfile @@ -8,7 +8,31 @@ RUN apt-get -y update && apt-get install -y --no-install-recommends \ r-base-dev \ ca-certificates -RUN R -e "install.packages(c('mda', 'plumber'), repos='https://cloud.r-project.org')" +RUN R -e "install.packages(c('Rcpp', 'BH', 'R6', 'jsonlite', 'crayon'), repos='https://cloud.r-project.org')" + +RUN wget http://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.2.4.tar.gz +RUN R CMD INSTALL stringi_1.2.4.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/rlang/rlang_0.2.2.tar.gz +RUN R CMD INSTALL rlang_0.2.2.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/magrittr/magrittr_1.5.tar.gz +RUN R CMD INSTALL magrittr_1.5.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/later/later_0.7.5.tar.gz +RUN R CMD INSTALL later_0.7.5.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/promises/promises_1.0.1.tar.gz +RUN R CMD INSTALL promises_1.0.1.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/httpuv/httpuv_1.4.4.2.tar.gz +RUN R CMD INSTALL httpuv_1.4.4.2.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/mda/mda_0.4-10.tar.gz +RUN R CMD INSTALL mda_0.4-10.tar.gz + +RUN wget http://cran.r-project.org/src/contrib/Archive/plumber/plumber_0.4.6.tar.gz +RUN R CMD INSTALL plumber_0.4.6.tar.gz COPY mars.R /opt/ml/mars.R COPY plumber.R /opt/ml/plumber.R diff --git a/hyperparameter_tuning/r_bring_your_own/tune_r_bring_your_own.ipynb b/hyperparameter_tuning/r_bring_your_own/tune_r_bring_your_own.ipynb index 7a8c873773..072a57b9a7 100644 --- a/hyperparameter_tuning/r_bring_your_own/tune_r_bring_your_own.ipynb +++ b/hyperparameter_tuning/r_bring_your_own/tune_r_bring_your_own.ipynb @@ -225,7 +225,7 @@ ")\n", "\n", "estimator = sagemaker.estimator.Estimator(\n", - " image_name=\"{}.dkr.ecr.{}.{}/rmars:latest\".format(account, region, domain),\n", + " image_uri=\"{}.dkr.ecr.{}.{}/rmars:latest\".format(account, region, domain),\n", " role=role,\n", " train_instance_count=1,\n", " train_instance_type=\"ml.m4.xlarge\",\n",