Skip to content

Compressed input? #338

Closed
Closed

Description

@skearnes

Is there any support for reading/writing compressed input files, e.g. with gzip? I would like to use the "standard" file format, but the uncompressed TFRecords files I am generating are huge for my datasets.

Activity

  1. vincentvanhoucke commented on Nov 24, 2015

    @vincentvanhoucke
    Contributor

    None yet. gzipping will unlikely result in significant compression due to the high entropy of the weights, but we're very interested in enabling compressed model representations at rest in general, especially for models that have to fit on mobile devices. I'll leave this bug open to track the feature request.

  2. delip commented on Nov 24, 2015

    @delip

    OP: have you tried using L1 regularization? How big are your model files
    after that?

    On Monday, November 23, 2015, Vincent Vanhoucke [email protected]
    wrote:

    None yet. gzipping will unlikely result in significant compression due to
    the high entropy of the weights, but we're very interested in enabling
    compressed model representations at rest in general, especially for models
    that have to fit on mobile devices. I'll leave this bug open to track the
    feature request.

    —
    Reply to this email directly or view it on GitHub
    #338 (comment)
    .

  3. skearnes commented on Nov 24, 2015

    @skearnes
    Author

    @vincentvanhoucke I've got a TFRecords file with ~9k Example protos that went from 115M to 1.7M after gzip. My input Features are (pretty sparse) float arrays, so I'm not surprised that compression helps a lot.

    @delip I'm focusing here on the input data, not the model checkpoints. The checkpoints do compress somewhat, but limiting the number and frequency of checkpoints is fine for now.

  4. delip commented on Nov 24, 2015

    @delip

    @skearnes sorry, not sure why I talked about model files 🎱

    +1 for this request. I would suggest using lzo for compression as opposed to gzip, as the former allows compressed files to be splittable. There's a reference use of lzo with protobufs in Twitter's elephantbird library.

  5. vincentvanhoucke commented on Nov 24, 2015

    @vincentvanhoucke
    Contributor

    I completely misunderstood your point, for some reason I assumed you meant checkpoints. FR stands, I agree that it might make a lot of sense to support something like that.

  6. added
    stat:contribution welcome
    on Dec 15, 2015
  7. llhe commented on Jul 22, 2016

    @llhe
    Contributor

    @vincentvanhoucke I guess @skearnes meaning compressing the training data instead of the checkpoints. In some cases, the input feature vectors are extremely sparse and compression will reduce the IO dramatically. So I'm also wondering whether the compression of TFRecord file will be supported in the future?

  8. NathanHowell commented on Aug 10, 2016

    @NathanHowell
    Contributor

    Looks like support for zlib compressed TFRecords was added in 90bad51

  9. tatatodd commented on Sep 6, 2016

    @tatatodd
    Contributor

    Indeed 90bad51 added support for zlib compressed TFRecords. Closing this issue out.

  10. added
    type:feature
    and removed on Feb 9, 2017
  11. added a commit that references this issue on Jun 20, 2017
  12. Remi-Coulom commented on Aug 24, 2017

    @Remi-Coulom

    Is it possible to read compressed raw files?

  13. added a commit that references this issue on Jan 23, 2020
  14. added a commit that references this issue on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:contribution welcometype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions