22 releases (14 breaking)

0.15.0 Sep 9, 2023
0.14.0 Apr 3, 2022
0.13.0 Jan 26, 2022
0.10.0 Nov 14, 2021
0.3.2 Jul 11, 2020

#612 in Parser implementations

Download history 2469/week @ 2023-12-04 2089/week @ 2023-12-11 2120/week @ 2023-12-18 1867/week @ 2023-12-25 2761/week @ 2024-01-01 3335/week @ 2024-01-08 2412/week @ 2024-01-15 2866/week @ 2024-01-22 3140/week @ 2024-01-29 1751/week @ 2024-02-05 1727/week @ 2024-02-12 1957/week @ 2024-02-19 2580/week @ 2024-02-26 2462/week @ 2024-03-04 2409/week @ 2024-03-11 1724/week @ 2024-03-18

9,274 downloads per month
Used in 3 crates

Custom license

380KB
7K SLoC

tfrecord

[ API doc | crates.io ]

The crate provides TensorFlow TFRecord data de/serialization and works with TensorBoard!

License

This software is distributed with MIT license. Please check the LICENSE file to see the full license text.


lib.rs:

The crate provides the functionality to serialize and deserialize TFRecord data format from TensorFlow.

Cargo Features

Optional features:

  • full: Enable all features.
  • async: Enable async/await feature.

Third-party crate supports:

  • with-serde: Enable interoperability with serde to serialize and deserialize example types.
  • with-tch: Enable tch types support.
  • with-image: Enable image types support.
  • with-ndarray: Enable ndarray types support.

Manualy ProtocolBuffer Code Generation

The crate compiles the pre-generated ProtocolBuffer code from TensorFlow. In the case of TensorFlow version update, you may generate the code manually. It accepts several ways to access the TensorFlow source code specified by TFRECORD_BUILD_METHOD environment variable. The generated code is placed under prebuild_src directory. See the examples below and change X.Y.Z to actual TensorFlow version.

Build from a source tarball

export TFRECORD_BUILD_METHOD="src_file:///home/myname/tensorflow-X.Y.Z.tar.gz"
cargo build --release --features generate_protobuf_src

Build from a source directory

export TFRECORD_BUILD_METHOD="src_dir:///home/myname/tensorflow-X.Y.Z"
cargo build --release --features generate_protobuf_src

Build from a URL

export TFRECORD_BUILD_METHOD="url://https://github.com/tensorflow/tensorflow/archive/vX.Y.Z.tar.gz"
cargo build --release --features generate_protobuf_src

Build from installed TensorFlow on system

The build script will search ${install_prefix}/include/tensorflow directory for protobuf documents.

export TFRECORD_BUILD_METHOD="install_prefix:///usr"
cargo build --release --features generate_protobuf_src

Dependencies

~4–20MB
~250K SLoC