Please fill out the form below.
System Information
- Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): TensorFlow
- Framework Version: 1.6.0 (not sure)
- Python Version: 3.6
- CPU or GPU: ...
- Python SDK Version: 1.2.3
- Are you using a custom image: No
Describe the problem
I am trying to use SageMaker end-to-end.
Training:
fromsagemaker.tensorflowimportTensorFlowjob_name=****estimator=TensorFlow(
entry_point='sagemaker-script.py',
source_dir=****,
role=role,
training_steps=1000,
evaluation_steps=100,
hyperparameters={
'learning_rate': 1e-04,
'input_layer': 'inputs',
'input_layer_full_name': 'inputs_input',
'max_len': 42
},
train_instance_count=1,
train_instance_type='ml.p3.2xlarge',
checkpoint_path=****)
estimator.fit(****, job_name=job_name)
predictor=estimator.deploy(initial_instance_count=1, instance_type='ml.m4.xlarge')
predict_data=****predictor.predict(predict_data.X)Where sagemaker-script.py is:
from __future__ importprint_function, unicode_literalsimportosimportpandasaspdimportnumpyasnpimporttensorflowastfimportyaml
...
defcreate_corpus(path):
****returntextdefkeras_model_fn(hyperparameters):
log.info('Calling keras_model_fn')
****returnmodeldeftrain_input_fn(training_dir=None, hyperparameters=None):
X, y=_input_fn(training_dir, hyperparameters)
returntf.estimator.inputs.numpy_input_fn(
x={hyperparameters['input_layer_full_name']: X},
y=y,
num_epochs=None,
shuffle=True)()
def_input_fn(training_dir, hyperparameters):
****train_data_gen=****returntrain_data_gen.X, train_data_gen.ydefeval_input_fn(training_dir=None, hyperparameters=None):
log.info("Calling eval_input_fn")
X, y=_eval_fn(training_dir, hyperparameters)
log.info("SIGNATURE: {}".format(hyperparameters['input_layer_full_name']))
log.info("eval_input_fn DONE")
returntf.estimator.inputs.numpy_input_fn(
x={hyperparameters['input_layer_full_name']: X},
y=y,
num_epochs=None,
shuffle=True)()
def_eval_fn(training_dir, hyperparameters):
****val_data_gen=****returnval_data_gen.X, val_data_gen.ydefserving_input_fn(hyperparameters):
char_indices=****# defines the input placeholdertensor=tf.placeholder(tf.int8, shape=[None, hyperparameters['max_len'], len(char_indices)])
serving_input_receiver=tf.estimator.export.build_raw_serving_input_receiver_fn(
{hyperparameters['input_layer_full_name']: tensor})()
# returns the ServingInputReceiver object.returnserving_input_receiverMinimal repo / logs
The prediction command results in the following:
AbortionError: AbortionError(code=StatusCode.INVALID_ARGUMENT, details="input tensor alias not found in signature: inputs. Inputs expected to be in the set {inputs_input}.")
[2018-04-26 13:42:32,944] ERROR in serving: AbortionError(code=StatusCode.INVALID_ARGUMENT, details="input tensor alias not found in signature: inputs. Inputs expected to be in the set {inputs_input}.")
Can you help me?
Thank you.
Please fill out the form below.
System Information
Describe the problem
I am trying to use SageMaker end-to-end.
Training:
Where
sagemaker-script.pyis:Minimal repo / logs
The prediction command results in the following:
Can you help me?
Thank you.