Skip to content

how to use pl to process tfrecords data? #8161

Answered by Borda
jaffe-fly asked this question in code help: CV
Discussion options

You must be logged in to vote

Depends on what data you have inside TFRecord, but you can see usage:
https://github.com/vahidk/tfrecord#reading-tfexample-records-in-pytorch

def train_dataloader():
    # index_path = None
    # tfrecord_path = "/tmp/data.tfrecord"
    # description = {"image": "byte", "label": "float"}
    dataset = TFRecordDataset(tfrecord_path, index_path, description)
    loader = torch.utils.data.DataLoader(dataset, batch_size=32)
    return loader

also check how to work with dataset - https://discuss.pytorch.org/t/read-dataset-from-tfrecord-format/16409/15

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@jaffe-fly
Comment options

@tshu-w
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Borda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants