zoukankan      html  css  js  c++  java
  • TensorFlow---基础---GFile

      使用TensorFlow的时候经常遇到 tf.gfile.exists()....

      关于gfile,一个googler是这样给出的解释:

    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.

       大概意思是:

        1. 提供了一个处理Python文件类型的API

        2. 提供了一种基于TensorFlow的C++文件系统的API实现

       总之,就是为了更好的可扩展性(C++文件系统API支持多种文件系统的实现,比如本地文件,谷歌云、HDFS)。所以不管你底层是以上的那种文件系统,都是用gfile来进行文件操作就ok了! 当然如果你只是单机本地跑的话,那么直接使用普通的py下 file-API也是ok的!

  • 相关阅读:
    读《大道至简》第二章有感
    《大道至简》读后感
    JAVA课后作业
    大道至简第三章观后感
    JAVA作业之两数的加减乘除
    JAVA作业之动手动脑
    第一次Java实验
    大道至简第二章观后感
    大道至简第一章观后感
    Django__admin的配置
  • 原文地址:https://www.cnblogs.com/luntai/p/6748877.html
Copyright © 2011-2022 走看看