amazon-sagemaker

Install graphiz on AWS Sagemaker

倾然丶 夕夏残阳落幕 提交于 2019-12-02 17:59:47
问题 This question was migrated from Data Science Stack Exchange because it can be answered on Stack Overflow. Migrated 9 months ago . I'm on a Jupyter notebook using Python3 and trying to plot a tree with code like this: import xgboost as xgb from xgboost import plot_tree plot_tree(model, num_trees=4) On the last line I get: ~/anaconda3/envs/python3/lib/python3.6/site-packages/xgboost/plotting.py in to_graphviz(booster, fmap, num_trees, rankdir, yes_color, no_color, **kwargs) 196 from graphviz

How can I invoke a SageMaker model, trained with TensorFlow, using a csv file in the body of the call? [duplicate]

瘦欲@ 提交于 2019-12-02 14:23:10
问题 This question already has answers here : How do I load python modules which are not available in Sagemaker? (2 answers) Closed 6 months ago . I have deployed a TensorFlow model on AWS SageMaker, and I want to be able to invoke it using a csv file as the body of the call. The documentation says about creating a serving_input_function like the one below: def serving_input_fn(hyperparameters): # Logic to the following: # 1. Defines placeholders that TensorFlow serving will feed with inference

How can I invoke a SageMaker model, trained with TensorFlow, using a csv file in the body of the call? [duplicate]

痴心易碎 提交于 2019-12-02 12:28:09
This question already has an answer here: How do I load python modules which are not available in Sagemaker? 2 answers I have deployed a TensorFlow model on AWS SageMaker, and I want to be able to invoke it using a csv file as the body of the call. The documentation says about creating a serving_input_function like the one below: def serving_input_fn(hyperparameters): # Logic to the following: # 1. Defines placeholders that TensorFlow serving will feed with inference requests # 2. Preprocess input data # 3. Returns a tf.estimator.export.ServingInputReceiver or tf.estimator.export

Install graphiz on AWS Sagemaker

拥有回忆 提交于 2019-12-02 11:55:27
I'm on a Jupyter notebook using Python3 and trying to plot a tree with code like this: import xgboost as xgb from xgboost import plot_tree plot_tree(model, num_trees=4) On the last line I get: ~/anaconda3/envs/python3/lib/python3.6/site-packages/xgboost/plotting.py in to_graphviz(booster, fmap, num_trees, rankdir, yes_color, no_color, **kwargs) 196 from graphviz import Digraph 197 except ImportError: --> 198 raise ImportError('You must install graphviz to plot tree') 199 200 if not isinstance(booster, (Booster, XGBModel)): ImportError: You must install graphviz to plot tree How do I install

How do I load python modules which are not available in Sagemaker?

江枫思渺然 提交于 2019-11-28 14:22:24
I want to install spacy which is not available as part of the Sagemaker platform. How should can I pip install it? When creating you model, you can specify the requirements.txt as an environment variable. For Eg. env = { 'SAGEMAKER_REQUIREMENTS': 'requirements.txt', # path relative to `source_dir` below. } sagemaker_model = TensorFlowModel(model_data = 's3://mybucket/modelTarFile, role = role, entry_point = 'entry.py', code_location = 's3://mybucket/runtime-code/', source_dir = 'src', env = env, name = 'model_name', sagemaker_session = sagemaker_session, ) This would ensure that the

Load S3 Data into AWS SageMaker Notebook

爱⌒轻易说出口 提交于 2019-11-27 23:01:22
I've just started to experiment with AWS SageMaker and would like to load data from an S3 bucket into a pandas dataframe in my SageMaker python jupyter notebook for analysis. I could use boto to grab the data from S3, but I'm wondering whether there is a more elegant method as part of the SageMaker framework to do this in my python code? Thanks in advance for any advice. If you have a look here it seems you can specify this in the InputDataConfig . Search for "S3DataSource" ( ref ) in the document. The first hit is even in Python, on page 25/26. import boto3 import pandas as pd from sagemaker

Load S3 Data into AWS SageMaker Notebook

醉酒当歌 提交于 2019-11-26 16:16:33
问题 I've just started to experiment with AWS SageMaker and would like to load data from an S3 bucket into a pandas dataframe in my SageMaker python jupyter notebook for analysis. I could use boto to grab the data from S3, but I'm wondering whether there is a more elegant method as part of the SageMaker framework to do this in my python code? Thanks in advance for any advice. 回答1: If you have a look here it seems you can specify this in the InputDataConfig . Search for "S3DataSource" (ref) in the