How to freeze a device specific saved model?
问题 I need to freeze saved models for serving, but some saved model is device specific, how to solve this? with tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) as sess: sess.run(tf.tables_initializer()) tf.saved_model.loader.load(sess, [tag_constants.SERVING], saved_model_dir) inference_graph_def=tf.get_default_graph().as_graph_def() for node in inference_graph_def.node: node.device = '' frozen_graph_path = os.path.join(frozen_dir, 'frozen_inference_graph.pb') output_keys = ['ToInt64