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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for tfreecord-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f15b9086d822602a8afb89a9351fcc792ec9ca12082cdd482ae41ee006b47394 |
|
MD5 | 206bf7ab512dd79bd8d4dc382687f486 |
|
BLAKE2b-256 | 4041e61f0be62c62ae2fdea2940a8c0b47ede15405acda9b587a061fcb7aebbe |