Skip to content

contradict/TFRecords.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages