contrib.framework.assign_from_checkpoint

tf.contrib.framework.assign_from_checkpoint

tf.contrib.framework.assign_from_checkpoint

assign_from_checkpoint(
    model_path,
    var_list
)

Defined in tensorflow/contrib/framework/python/ops/variables.py.

See the guide: Framework (contrib) > Variables

Creates an operation to assign specific variables from a checkpoint.

Args:

  • model_path: The full path to the model checkpoint. To get latest checkpoint use model_path = tf.train.latest_checkpoint(checkpoint_dir)
  • var_list: A list of (possibly partitioned) Variable objects or a dictionary mapping names in the checkpoint to the corresponding variables or list of variables to initialize from that checkpoint value. For partitioned Variables, the name in the checkpoint must be the full variable, not the name of the partitioned variable, eg. "my_var" rather than "my_var/part_4". If empty, returns no_op(), {}.

Returns:

the restore_op and the feed_dict that need to be run to restore var_list.

Raises:

  • ValueError: If the checkpoint specified at model_path is missing one of the variables in var_list.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/framework/assign_from_checkpoint

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部