Python Tensorflow.restore中输入的格式
我使用的模型中的一个参数是以下文件,该文件以名称checkpoint(无扩展名)传递: 模型检查点路径:“epoch-29” 所有模型检查点路径:“epoch-29” 它用于以下代码段中:Python Tensorflow.restore中输入的格式,python,python-3.x,tensorflow,tensorflow2.0,Python,Python 3.x,Tensorflow,Tensorflow2.0,我使用的模型中的一个参数是以下文件,该文件以名称checkpoint(无扩展名)传递: 模型检查点路径:“epoch-29” 所有模型检查点路径:“epoch-29” 它用于以下代码段中: parser = argparse.ArgumentParser() parser.add_argument('--checkpoint', help='path to checkpoint to restore',default='epoch') args = parser.parse_arg
parser = argparse.ArgumentParser()
parser.add_argument('--checkpoint', help='path to checkpoint to restore',default='epoch')
args = parser.parse_args()
# load config
config = generate_config()
# build model and restore from checkpoint
model = build_model(num_output_neurons=config.n_output_neurons, y_input=config.n_mels, num_units=config.n_dense_units, num_filts=config.n_filters)
checkpoint = tf.train.Checkpoint(model=model)
checkpoint.restore(args.checkpoint)
我得到以下错误:
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file ...: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
方法还原的正确格式是什么?检查注释