Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFRecords File is too big! 10X the size of parquet #47

Open
kart2k15 opened this issue Mar 9, 2022 · 2 comments
Open

TFRecords File is too big! 10X the size of parquet #47

kart2k15 opened this issue Mar 9, 2022 · 2 comments

Comments

@kart2k15
Copy link

kart2k15 commented Mar 9, 2022

See similar git issues here:--
tensorflow/ecosystem#61 (comment)
tensorflow/ecosystem#61
tensorflow/ecosystem#106

This how I'm writing a PySpark dataframe to tf-records to an S3 bucket:---

s3_path = "s3://Shuks/dataframe_tf_records"   
df.write.mode("overwrite").format("tfrecord").option("recordType", "Example").save(s3_path)

This creates a new key/"directory" on S3 with the following path : s3://Shuks/dataframe_tf_records/
And under this directory are all the tf-records.

How do I specify compression type during conversion?

@junshi15
Copy link
Contributor

junshi15 commented Apr 8, 2022

try this:
option("codec","org.apache.hadoop.io.compress.GzipCodec")

@sosixyz
Copy link

sosixyz commented May 22, 2024

try this: option("codec","org.apache.hadoop.io.compress.GzipCodec")
I use this method, data.repartition(50).write.mode("overwrite").format('tfrecords').option("codec", "org.apache.hadoop.io.compress.GzipCodec").save(path), but the file seems not to be small. the option did not take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants