【发布时间】:2019-06-11 21:42:18
【问题描述】:
我需要将估算器导出器代码从 tensorflow 1.x 转换为 2 并去掉占位符。有人知道如何正确操作吗?
我已经尝试过 features = {'input': tf.compat.v1.placeholder(tf.float32, shape=(1, 224, 224, 3), name="input")} ,但这不起作用正如我所料
features = {'input': tf.placeholder(tf.float32, shape=(1, 224, 224, 3), name="input")}
input_fn = tf.estimator.export.build_raw_serving_input_receiver_fn(features, 1)
exported_model_path = estimator.export_savedmodel(args.model_dir, input_fn)
【问题讨论】: