You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi lei mao:
Thanks for your blog <<Save, Load and Inference From TensorFlow Frozen Graph>> , that benefits a lot to me as I’m enabling
a style transfer model from tf-hub.
I come across some problems, simply using codes it’s like this:
import tensorflow_hub as hub hub_handle = 'https://hub.tensorflow.google.cn/google/magenta/arbitrary-image-stylization-v1-256/2’ style_model = hub.load(hub_handle)
The style_model is a saved model: tensorflow.python.saved_model.load.Loader._recreate_base_user_object._UserObject
we can use the style_model to get stylized image prediction:
Hi lei mao:
Thanks for your blog <<Save, Load and Inference From TensorFlow Frozen Graph>> , that benefits a lot to me as I’m enabling
a style transfer model from tf-hub.
I come across some problems, simply using codes it’s like this:
import tensorflow_hub as hub
hub_handle = 'https://hub.tensorflow.google.cn/google/magenta/arbitrary-image-stylization-v1-256/2’
style_model = hub.load(hub_handle)
The style_model is a saved model: tensorflow.python.saved_model.load.Loader._recreate_base_user_object._UserObject
we can use the style_model to get stylized image prediction:
outputs = style_model(tf.constant(content_image), tf.constant(style_image))
I can also get the signatures as a function to run the model
func = style_model.signatures['serving_default']
outputs = func(tf.constant(content_image), tf.constant(style_image))
Then I try to freeze the func.graph but I come across problems
[op.type for op in func.graph.get_operations()]
The feeds and variables all become Placeholder!
['Placeholder', 'Placeholder', 'Placeholder', 'Placeholder', 'Placeholder’….. 'StatefulPartitionedCall', 'Identity']
Do you know how this happened? Or any solutions about this issue? Many thanks!
Thanks!
The text was updated successfully, but these errors were encountered: