现在,我像这样导出我的张量流估计器:
def receiver():
shape = (None,estimator.params['n_channels'])
features = {
'waveform': tf.compat.v1.placeholder(tf.float32,shape=shape),'audio_id': tf.compat.v1.placeholder(tf.string)}
return tf.estimator.export.ServingInputReceiver(features,features)
estimator.export_saved_model(directory,receiver)
但是,这会生成一个小的.pb文件和一个带有大 variables.data-00000-of-00001 文件的子文件夹 ./ variables 和一个 variables.index 文件。
是否有其他命令可以让我仅将估算器导出为单个大型.pb文件,而不包含所需的所有内容?这样会更方便使用和重新分发。