Skip to main content

No project description provided

Project description

TFReecord

Read & Write TFRecord without heavy Tensorflow.

pip3 install tfreecord

Example

Write TFRecord

import tfreecord

writer = tfreecord.RecordWriter()
feature = {
    'id': writer.int64_feature(759),
    'text': writer.bytes_feature("Now rides our knight".encode("utf-8")),
    'label': writer.bytes_feature("poem".encode("utf-8")),
}

with open("poems.tfrecord", "ab") as f:
    f.write(writer.encode_example(feature))

Read TFRecord

import tfreecord

reader = tfreecord.RecordReader()

for data in reader.read_from_tfrecord("poems.tfrecord"):
    print(data)

Thanks to Jong Wook Kim blog post about TFRecords here and his tfrecord_lite library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfreecord-1.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfreecord-1.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file tfreecord-1.0.0.tar.gz.

File metadata

  • Download URL: tfreecord-1.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6

File hashes

Hashes for tfreecord-1.0.0.tar.gz
Algorithm Hash digest
SHA256 41210ea9f6062503b64d99a93157cd3d28bba2a7560135fcc2cf8539e27f95b0
MD5 d041498a5e0b008a4d2df1b255d7eb3d
BLAKE2b-256 fd053c5292dc5c95677fd080c9c04771f1978b683025825bf439e3df7f5247d0

See more details on using hashes here.

File details

Details for the file tfreecord-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tfreecord-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.6

File hashes

Hashes for tfreecord-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f15b9086d822602a8afb89a9351fcc792ec9ca12082cdd482ae41ee006b47394
MD5 206bf7ab512dd79bd8d4dc382687f486
BLAKE2b-256 4041e61f0be62c62ae2fdea2940a8c0b47ede15405acda9b587a061fcb7aebbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page