Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 943 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 943 Bytes

TFRecords.jl

Read and write tf.Example values from a file. The format is described here.

Install

] add https://github.com/contradict/TFRecords.jl

Installation fetches the .proto files defining the data format from the github Tensorflow repository, so network access is needed to build. See deps/build.jl for the gory details.

Read

julia> using TFRecords
julia> tfrecord_file = TFRecord("filename.tfrecord")
julia> records = Iterators.Stateful(tfrecord_file)
julia> record = popfirst!(records)

For convenience, parse_example will turn the Example structure into a Dict{String, Array{T, 1}} for.

julia> record_dict = parse_example(record)

Write

julia> output_file = open("filename.tfrecord")
julia> e = build_example(Dict("value" => Array{Int64, 1}([1])))
julia> writeexample(outputfile, e)