TFRecords
Simple standard + tools for I/O of TFRecords
pip install tensorflow-records
I/O
import tensorflow as tf
import tf.records as tfr
image = tf.ones([1024, 768, 3], dtype=tf.uint8)
label = tf.constant('cat')
spec = tfr.spec(
image=tfr.Tensor([1024, 768, 3], dtype='int'),
label='string'
)
serialized = tfr.serialize(spec, image=x, label=y)
# b'\n+\n\x10\n\x05label\x12\x07\n\x05\n\x03cat\n\x17\n\x05image\x1...'
tfr.parse(spec).sample(tf.constant(serialized))
# { 'image': <tf.Tensor: shape=(1024, 768, 3) ...>, 'label': <tf.Tensor: shape=() ...> }
# or you can parse multiple at once
tfr.parse(spec).batch(tf.constant([serialized, serialized]))
# { 'image': <tf.Tensor: shape=(2, 1024, 768, 3) ...>, 'label': <tf.Tensor: shape=(2,) ...> }
Metadata
Release files for tensorflow-records 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tensorflow_records-0.1.14.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tensorflow_records-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / tensorflow_records-0.1.14.tar.gz
| Download URL | tensorflow_records-0.1.14.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8fc4c42044b77a1a0b007b305a690b7f5e80db9da90aeff94ec6c3c1487e944a
|
|
BLAKE2b-256 checksum How to use checksums |
b8991619964cb4dc7e54849eeaf8922592d13dcce34bcf39e8163b9f4f61586f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|
Release files / tensorflow_records-0.1.14-py3-none-any.whl
| Download URL | tensorflow_records-0.1.14-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d46d391a634a00d3ad6c79e0d51a622b3ea210ead8d0e3eba1ae7e4fa990e0d4
|
|
BLAKE2b-256 checksum How to use checksums |
10f7476f9da667ffc90df13fa6d51b91b1ee6beea4d357dec7739c818f0a9f78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.9
|