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的!

  • 相关阅读:
    图解插入排序
    图解冒泡排序
    break 和continue的两种用法
    循环的使用选择
    jstl标签库使用报错index_jsp.java找不到问题
    [Android 除錯] Conflict with dependency
    jQueryMobile 網頁使用 ASP.NET Web API 服務
    Chart.js 與 ASP.NET MVC 整合應用
    HTML5 新增的 input 事件
    ASP.NET MVC 5 實作 GridView 分頁
  • 原文地址:https://www.cnblogs.com/luntai/p/6748877.html
Copyright © 2011-2022 走看看