Why use tensorflow gfile? (for file I/O)

后端 未结 1 544
感情败类
感情败类 2021-02-05 10:28

Tensorflow code uses methods for file I/O that are different than python builtin methods. According to the source code, it is useful as

\"File I/O wrappe

相关标签:
1条回答
  • 2021-02-05 11:19

    This comment:

    File I/O wrappers without thread locking

    ...is a particularly unhelpful description for TensorFlow's tf.gfile module!

    The main roles of the tf.gfile module are:

    1. To provide an API that is close to Python's file objects, and
    2. To provide an implementation based on TensorFlow's C++ FileSystem API.

    The C++ FileSystem API supports multiple file system implementations, including local files, Google Cloud Storage (using a gs:// prefix), and HDFS (using an hdfs:// prefix). TensorFlow exports these as tf.gfile so that you can uses these implementations for saving and loading checkpoints, writing TensorBoard logs, and accessing training data (among other uses). However, if all of your files are local, you can use the regular Python file API without any problem.

    0 讨论(0)
提交回复
热议问题