# TFRecord problem

**URL:** <https://discuss.ai.google.dev/t/tfrecord-problem/27202>\
**Category:** General Discussion\
**Tags:** docs, sig\_io, help\_request, tfdata\
**Created:** [June 29, 2021, 12:15pm UTC](https://discuss.ai.google.dev/t/tfrecord-problem/27202 "2021-06-29T12:15:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Stark](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ryan_stark/32/7876_2.png) [@Ryan\_Stark](https://discuss.ai.google.dev/u/Ryan_Stark)\
**Post date:** [June 29, 2021, 12:15pm UTC](https://discuss.ai.google.dev/t/tfrecord-problem/27202/1 "2021-06-29T12:15:06Z")

</div>

What is the different between tf.data.experimental.TFRecordWriter and tf.io.TFRecordWriter?

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [June 29, 2021, 2:07pm UTC](https://discuss.ai.google.dev/t/tfrecord-problem/27202/2 "2021-06-29T14:07:55Z")

</div>

E.g. this official tutorial mix both the API. /cc @markdaoust

> **[TFRecord and tf.train.Example  |  TensorFlow Core](https://www.tensorflow.org/tutorials/load_data/tfrecord)**

---

<div class="post-metadata">

**Author:** ![Mark\_Daoust](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/mark_daoust/32/411_2.png) [@Mark\_Daoust](https://discuss.ai.google.dev/u/Mark_Daoust)\
**Post date:** [June 29, 2021, 6:18pm UTC](https://discuss.ai.google.dev/t/tfrecord-problem/27202/3 "2021-06-29T18:18:42Z")

</div>

That’s the right link, thanks @Bhack.

The main differences are:

- `tf.io.TFRecordWriter` is a python interface where you call `writer.write(example)`.
- `tf.data.experimental.TFRecordWriter` is experimental, and writes out a whole `tf.data.Dataset`. If you already have your data in a tf.data.Dataset, that may be simpler.
