codecamp

TensorFlow函数教程:tf.io.TFRecordOptions

tf.io.TFRecordOptions函数

类 TFRecordOptions

别名:

  • 类 tf.io.TFRecordOptions
  • 类 tf.python_io.TFRecordOptions

定义在:tensorflow/python/lib/io/tf_record.py。

用于操作TFRecord文件的选项。

__init__

__init__(
    compression_type=None,
    flush_mode=None,
    input_buffer_size=None,
    output_buffer_size=None,
    window_bits=None,
    compression_level=None,
    compression_method=None,
    mem_level=None,
    compression_strategy=None
)

创建一个TFRecordOptions实例。

当compression_type不是None时,选项仅影响TFRecordWriter。可以在zlib_compression_options.h和zlib手册中找到文档,详细信息和默认值。将选项保留为None,允许C ++设置合理的默认值。

参数:

  • compression_type:TFRecordCompressionType或None。
  • flush_mode:flush模式或None,默认值:Z_NO_FLUSH。
  • input_buffer_size:int或None。
  • output_buffer_size:int或None。
  • window_bits:int或None。
  • compression_level:0到9,或None。
  • compression_method:压缩方法或None。
  • mem_level:1到9,或None。
  • compression_strategy:策略或None。默认值:Z_DEFAULT_STRATEGY。

返回:

一个TFRecordOptions对象。

可能引发的异常:

  • ValueError:如果compression_type无效。

方法

get_compression_type_string

@classmethod
get_compression_type_string(
    cls,
    options
)

将各种选项类型转换为统一字符串。

参数:

  • options:TFRecordOption,TFRecordCompressionType或字符串。

返回:

压缩类型为字符串(例如'ZLIB','GZIP'或'')。

可能引发的异常:

  • ValueError:如果compression_type无效。

类成员

compression_type_map

TensorFlow函数教程:tf.io.TFRecordCompressionType
TensorFlow函数教程:tf.io.TFRecordWriter
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }