{
  "id": 433241,
  "title": "Classes and Flowers ",
  "url": "/competitions/tpu-getting-started/discussion/433241",
  "author_name": "Brad Williams",
  "post_date": "2023-08-21T02:47:17.914000",
  "votes": 0,
  "comment_count": 2,
  "views": null,
  "content": "<p>Hi, when I read the total training and validation set I only see 92 images ? and not all of them cover the 104 possible classes. Is this correct ? </p>\n<p>Should we then fill the missing classes with examples from the test set ?</p>",
  "messages": [
    {
      "id": 3169773,
      "postDate": "2025-04-03T20:31:40.257Z",
      "content": "<p>The 4 folders contains the same pics with different resolutions !</p>\n<p>with this code</p>\n<blockquote>\n  <p>def count_examples_in_tfrecord(tfrecord_path):<br>\n           \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"<br>\n           return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))</p>\n</blockquote>\n<p>then</p>\n<blockquote>\n  <p>for resolution in ['192x192','224x224','331x331','512x512']:<br>\n      print(f\"\\nResolution {resolution}\")<br>\n      for doss in [\"train\", \"val\", \"test\"]:<br>\n          # Lister tous les fichiers TFRecord<br>\n          tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')<br>\n          # Compter les images dans chaque fichier et faire la somme<br>\n          total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)<br>\n          print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")</p>\n</blockquote>\n<p>you get :</p>\n<blockquote>\n  <p>Resolution 192x192<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 224x224<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 331x331<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 512x512<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382</p>\n</blockquote>\n<p>Excuse my french 🤪</p>",
      "rawMarkdown": "The 4 folders contains the same pics with different resolutions !\n\nwith this code\n\n>def count_examples_in_tfrecord(tfrecord_path):\n         \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"\n         return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))\n\nthen\n\n>for resolution in ['192x192','224x224','331x331','512x512']:\n    print(f\"\\nResolution {resolution}\")\n    for doss in [\"train\", \"val\", \"test\"]:\n        # Lister tous les fichiers TFRecord\n        tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')\n        # Compter les images dans chaque fichier et faire la somme\n        total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)\n        print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")\n\nyou get :\n\n>Resolution 192x192\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 224x224\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 331x331\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 512x512\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n\nExcuse my french 🤪"
    },
    {
      "id": 2400395,
      "postDate": "2023-08-21T03:50:24.173Z",
      "content": "<p>Here is my simple data read so far: <a href=\"https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal\" target=\"_blank\">https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal</a></p>",
      "rawMarkdown": "Here is my simple data read so far: https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal"
    },
    {
      "id": 2400350,
      "postDate": "2023-08-21T02:47:17.913Z",
      "content": "<p>Hi, when I read the total training and validation set I only see 92 images ? and not all of them cover the 104 possible classes. Is this correct ? </p>\n<p>Should we then fill the missing classes with examples from the test set ?</p>",
      "rawMarkdown": "Hi, when I read the total training and validation set I only see 92 images ? and not all of them cover the 104 possible classes. Is this correct ? \n\nShould we then fill the missing classes with examples from the test set ?"
    }
  ],
  "comments": [
    {
      "id": 3169773,
      "author_name": "Didier Flamm",
      "author_url": "",
      "post_date": "2025-04-03T20:31:40.257000",
      "content": "<p>The 4 folders contains the same pics with different resolutions !</p>\n<p>with this code</p>\n<blockquote>\n  <p>def count_examples_in_tfrecord(tfrecord_path):<br>\n           \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"<br>\n           return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))</p>\n</blockquote>\n<p>then</p>\n<blockquote>\n  <p>for resolution in ['192x192','224x224','331x331','512x512']:<br>\n      print(f\"\\nResolution {resolution}\")<br>\n      for doss in [\"train\", \"val\", \"test\"]:<br>\n          # Lister tous les fichiers TFRecord<br>\n          tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')<br>\n          # Compter les images dans chaque fichier et faire la somme<br>\n          total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)<br>\n          print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")</p>\n</blockquote>\n<p>you get :</p>\n<blockquote>\n  <p>Resolution 192x192<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 224x224<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 331x331<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382<br>\n  _<br>\n  Resolution 512x512<br>\n  Nombre total d'images dans les TFRecords train: 12753<br>\n  Nombre total d'images dans les TFRecords val: 3712<br>\n  Nombre total d'images dans les TFRecords test: 7382</p>\n</blockquote>\n<p>Excuse my french 🤪</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2400395,
      "author_name": "Brad Williams",
      "author_url": "",
      "post_date": "2023-08-21T03:50:24.173000",
      "content": "<p>Here is my simple data read so far: <a href=\"https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal\" target=\"_blank\">https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal</a></p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "3169773": "The 4 folders contains the same pics with different resolutions !\n\nwith this code\n\n>def count_examples_in_tfrecord(tfrecord_path):\n         \"\"\"Compte le nombre d'images dans un fichier TFRecord.\"\"\"\n         return sum(1 for _ in tf.data.TFRecordDataset(tfrecord_path))\n\nthen\n\n>for resolution in ['192x192','224x224','331x331','512x512']:\n    print(f\"\\nResolution {resolution}\")\n    for doss in [\"train\", \"val\", \"test\"]:\n        # Lister tous les fichiers TFRecord\n        tfrecord_files = tf.io.gfile.glob(GCS_DS_PATH + '/tfrecords-jpeg-'+resolution+'/' + doss + '/*.tfrec')\n        # Compter les images dans chaque fichier et faire la somme\n        total_images = sum(count_examples_in_tfrecord(file) for file in tfrecord_files)\n        print(f\"Nombre total d'images dans les TFRecords {doss}: {total_images}\")\n\nyou get :\n\n>Resolution 192x192\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 224x224\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 331x331\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n_\n>Resolution 512x512\nNombre total d'images dans les TFRecords train: 12753\nNombre total d'images dans les TFRecords val: 3712\nNombre total d'images dans les TFRecords test: 7382\n\nExcuse my french 🤪",
    "2400395": "Here is my simple data read so far: https://www.kaggle.com/williamsabrad/simple-read-petals-to-the-metal",
    "2400350": "Hi, when I read the total training and validation set I only see 92 images ? and not all of them cover the 104 possible classes. Is this correct ? \n\nShould we then fill the missing classes with examples from the test set ?"
  }
}