【问题标题】:tensorflow model: what is the difference between .data-00000-of-00002 and ,data-00001-of-00002?tensorflow 模型:.data-00000-of-00002 和 ,data-00001-of-00002 有什么区别?
【发布时间】:2020-02-07 09:38:42
【问题描述】:

在存储一个tensorflow ckpt时,除了.index、.meta和checkpoint文件之外,还有两个“.data”文件同时保存:.data-00000-of-00002和.data-00001-of- 00002。前者的尺寸远小于后者。我的问题是,为什么保存了两个数据文件,它们之间有什么区别?

【问题讨论】:

    标签: tensorflow model store


    【解决方案1】:

    据tensorflow官方page报道: 一个或多个分片(<prefix>-<global_step>.data-<shard_index>-of-<number_of_shards>)包含模型的权重,索引文件包含哪些权重存储在哪个分片中。分片数量取决于您用于训练的机器数量。

    因此,如果您在两台机器上训练一个模型,您将拥有两个带后缀的分片:.data-00000-of-00002.data-00001-of-00002

    您也可以查看this url

    在实例化tf.train.Saver时,您可以设置参数sharded的值(默认值为False)。 sharded=True 指示 Saver 对每台机器/设备的检查点进行分片。

    【讨论】:

      猜你喜欢
      • 2020-09-29
      • 2020-09-12
      • 2021-09-13
      • 2010-09-28
      • 1970-01-01
      • 2020-12-03
      • 2017-08-11
      • 2018-06-18
      • 2018-10-23
      相关资源
      最近更新 更多