-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Using customized tensor name for prediction after deploying the model #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello @vbvg2008 , I believe that this issue is related to aws/sagemaker-tensorflow-training-toolkit#71. Thanks for using SageMaker! |
@mvsusp The problem is fixed on the container side, but now we need to make a fix to the Python SDK to serialize numpy arrays in dicts correctly. @vbvg2008 in the meantime, if you want to unblock yourself, try the workaround described here: Basically, convert your numpy arrays into lists before putting them in the dict. |
_parse_json_request
should handle dictionaries properly
aws/sagemaker-tensorflow-training-toolkit#71
hi @winstonaws, |
hi @eL0ck, We have merged in a change to accept dicts with numpy arrays on the python sdk side - #404 . random_image = np.random.rand(32, 32, 3) Please let us know if the problems persists. |
Update KMS encryption notebook with steps for batch transformation
Please fill out the form below.
System Information
Describe the problem
All of the Sagemaker tensorflow tutorial uses "inputs" as the input name for prediction. for example, in "tensorflow_resnet_cifar10_with_tensorboard" example, the prediction is simply done by
random_image = np.random.rand(32, 32, 3)
predictor.predict(random_image_data)
but what if I trained a tensorflow model with a customized input name? say my model inputs only accepts a dictionary like this:
inputs = {"input_image": tf.placeholder(tf.float32, [None, 32, 32, 3])}
Although I successfully trained and deployed the model, but when I try to do the prediction such as:
random_image = np.random.rand(32, 32, 3)
predictor.predict({'input_image':random_image})
it gives me error saying my data is not JSON serializable. How do I use a customized name as input name for prediction?
The text was updated successfully, but these errors were encountered: