{
  "id": 314380,
  "title": "How to upsampe with TFRecordDatasetV2 and  rejection_resample ",
  "url": "/competitions/happy-whale-and-dolphin/discussion/314380",
  "author_name": "k_tomo",
  "post_date": "2022-03-22T12:20:00.495000",
  "votes": 1,
  "comment_count": 0,
  "views": 0,
  "content": "<p>I want to upsample with tfrec file. Therefore,to use <a href=\"https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample\" target=\"_blank\">https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample</a> function,</p>\n<p>I wrote code like this.</p>\n<pre><code>filename = [\"example.tfrec\"]\ndataset = tf.data.TFRecordDataset(filenames)\ndataset = dataset.rejection_resample(**some_args)\n</code></pre>\n<p>but error message </p>\n<blockquote>\n  <p>AttributeError: 'TFRecordDatasetV2' object has no attribute 'rejection_resample'</p>\n</blockquote>\n<p>was returned.</p>\n<p>How can I convert from  TFRecordDatasetV2  to tf.data.Dataset？<br>\nOr any other way to call rejection_resample method？<br>\nOr should  I use completely different way  to upsample?</p>\n<p>If you have any solution, please help me 🙏</p>",
  "messages": [
    {
      "id": 1731490,
      "postDate": "2022-03-22T12:20:00.497Z",
      "content": "<p>I want to upsample with tfrec file. Therefore,to use <a href=\"https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample\" target=\"_blank\">https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample</a> function,</p>\n<p>I wrote code like this.</p>\n<pre><code>filename = [\"example.tfrec\"]\ndataset = tf.data.TFRecordDataset(filenames)\ndataset = dataset.rejection_resample(**some_args)\n</code></pre>\n<p>but error message </p>\n<blockquote>\n  <p>AttributeError: 'TFRecordDatasetV2' object has no attribute 'rejection_resample'</p>\n</blockquote>\n<p>was returned.</p>\n<p>How can I convert from  TFRecordDatasetV2  to tf.data.Dataset？<br>\nOr any other way to call rejection_resample method？<br>\nOr should  I use completely different way  to upsample?</p>\n<p>If you have any solution, please help me 🙏</p>",
      "rawMarkdown": "I want to upsample with tfrec file. Therefore,to use https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample function,\n\n I wrote code like this.\n\n```tf.py\nfilename = [\"example.tfrec\"]\ndataset = tf.data.TFRecordDataset(filenames)\ndataset = dataset.rejection_resample(**some_args)\n```\n\nbut error message \n> AttributeError: 'TFRecordDatasetV2' object has no attribute 'rejection_resample'\n\nwas returned.\n\nHow can I convert from  TFRecordDatasetV2  to tf.data.Dataset？\nOr any other way to call rejection_resample method？\nOr should  I use completely different way  to upsample?\n\nIf you have any solution, please help me 🙏\n\n\n \n\n\n\n",
      "votes": 1
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1731490": "I want to upsample with tfrec file. Therefore,to use https://www.tensorflow.org/api_docs/python/tf/data/Dataset#rejection_resample function,\n\n I wrote code like this.\n\n```tf.py\nfilename = [\"example.tfrec\"]\ndataset = tf.data.TFRecordDataset(filenames)\ndataset = dataset.rejection_resample(**some_args)\n```\n\nbut error message \n> AttributeError: 'TFRecordDatasetV2' object has no attribute 'rejection_resample'\n\nwas returned.\n\nHow can I convert from  TFRecordDatasetV2  to tf.data.Dataset？\nOr any other way to call rejection_resample method？\nOr should  I use completely different way  to upsample?\n\nIf you have any solution, please help me 🙏\n\n\n \n\n\n\n"
  }
}