Last active
August 6, 2018 01:40
-
-
Save morenoh149/8bc94ee73b848592a916e030b8c3ae7c to your computer and use it in GitHub Desktop.
following https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/census/keras/trainer/model.py#L83
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
import tensorflow as tf | |
from keras import backend as K | |
from tensorflow.python.saved_model import builder as saved_model_builder | |
from tensorflow.python.saved_model import tag_constants, signature_constants | |
from tensorflow.python.saved_model.signature_def_utils_impl import predict_signature_def | |
builder = saved_model_builder.SavedModelBuilder('vgg16_no_augmentation_export') | |
signature = predict_signature_def(inputs={'input': parallel_model.inputs[0]}, | |
outputs={'income': parallel_model.outputs[0]}) | |
with K.get_session() as sess: | |
builder.add_meta_graph_and_variables( | |
sess=sess, | |
tags=[tag_constants.SERVING], | |
signature_def_map={ | |
signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: signature} | |
) | |
builder.save() |
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
attempting to create this model | |
$ gcloud ml-engine versions create v2 --model=plantDisease01 --origin=gs://${BUCKET_NAME}/plantDisease01 --runtime-version=1.4 | |
Creating version (this might take a few minutes)......failed. | |
ERROR: (gcloud.ml-engine.versions.create) Bad model detected with error: "Failed to load model: Loading servable: {name: default version: 1} failed: Not found: Op type not registered 'ClipByValue' in binary running on localhost. Make sure the Op and Kernel are registered | |
in the binary running in this process.\n\n (Error code: 0)" |
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
INFO:tensorflow:No assets to save. | |
INFO:tensorflow:No assets to write. | |
INFO:tensorflow:SavedModel written to: b'vgg16_no_augmentation_export/saved_model.pb' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment