{
  "id": 125886,
  "title": "Getting started with fastai2",
  "url": "/competitions/bengaliai-cv19/discussion/125886",
  "author_name": "",
  "post_date": "2020-01-14T10:51:01.574869300Z",
  "votes": 8,
  "comment_count": 6,
  "views": 0,
  "content": "<p>I just shared this kernel featuring the new version of fastai :)</p>\n\n<p><a href=\"https://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598\">https://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598</a></p>",
  "messages": [
    {
      "id": "718386",
      "postDate": "01/14/2020 10:51:01",
      "content": "<p>I just shared this kernel featuring the new version of fastai :)</p>\n\n<p><a href=\"https://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598\">https://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598</a></p>",
      "rawMarkdown": "I just shared this kernel featuring the new version of fastai :)\n\nhttps://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598",
      "votes": null
    },
    {
      "id": "718441",
      "postDate": "01/14/2020 12:16:36",
      "content": "<p>Great work. Thanks for sharing. </p>",
      "rawMarkdown": "Great work. Thanks for sharing.",
      "votes": null
    },
    {
      "id": "718803",
      "postDate": "01/14/2020 19:59:31",
      "content": "<p>Hi! Thanks for sharing! I am new with fastai  (I usually use Pytorch but I have no time and I am playing for first time with fastai). I want to use SWA since people says that improve the results here but I am not able to find implementations on fastai, but yes at Pytorch... Do you know If there is a simple way? Same with Cutmix. Thanks!</p>",
      "rawMarkdown": "Hi! Thanks for sharing! I am new with fastai  (I usually use Pytorch but I have no time and I am playing for first time with fastai). I want to use SWA since people says that improve the results here but I am not able to find implementations on fastai, but yes at Pytorch... Do you know If there is a simple way? Same with Cutmix. Thanks!",
      "votes": null
    },
    {
      "id": "718911",
      "postDate": "01/15/2020 00:14:14",
      "content": "<p>Take a look at callbacks in the documentation <a href=\"https://docs.fast.ai/callback.html\">https://docs.fast.ai/callback.html</a>. You can see the code for MixUp for example to have an idea how it works. This is for fastai v1 but for v2 the same applies but with other names.</p>",
      "rawMarkdown": "Take a look at callbacks in the documentation https://docs.fast.ai/callback.html. You can see the code for MixUp for example to have an idea how it works. This is for fastai v1 but for v2 the same applies but with other names.",
      "votes": null
    },
    {
      "id": "762167",
      "postDate": "03/03/2020 09:23:48",
      "content": "<p>Sorry for disturbing you, as I use fastai1, I use data block to get data like below(learn from iafoss)\n<code>\n%%time\nstats = ([0.0692], [0.2051])\ndata = ( ImageList.from_df(train_labels, path='.', folder=TRAIN,\n                           suffix='.png', cols='image_id', convert_mode='L')\n        .split_by_rand_pct(0.2)\n        .label_from_df(cols=['grapheme_root', 'vowel_diacritic', 'consonant_diacritic'])\n        .transform(tfms, size=128)\n        .databunch(bs=16)\n        .normalize(stats)\n)\n</code>\nHowever, the labels didn't display correctly when I call show_batch(), can you hint me how to deal with it(display like y1;y2;y3 or your fastai2 notebook)? I have searched over the forum but seems gain nothing...\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fc2fef37567863516fb521bf00b77fd6e%2FDataBlockLabelMess.png?generation=1583227320316050&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Sorry for disturbing you, as I use fastai1, I use data block to get data like below(learn from iafoss)\n```\n%%time\nstats = ([0.0692], [0.2051])\ndata = ( ImageList.from_df(train_labels, path='.', folder=TRAIN,\n                           suffix='.png', cols='image_id', convert_mode='L')\n        .split_by_rand_pct(0.2)\n        .label_from_df(cols=['grapheme_root', 'vowel_diacritic', 'consonant_diacritic'])\n        .transform(tfms, size=128)\n        .databunch(bs=16)\n        .normalize(stats)\n)\n```\nHowever, the labels didn't display correctly when I call show_batch(), can you hint me how to deal with it(display like y1;y2;y3 or your fastai2 notebook)? I have searched over the forum but seems gain nothing...\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fc2fef37567863516fb521bf00b77fd6e%2FDataBlockLabelMess.png?generation=1583227320316050&amp;alt=media)",
      "votes": null
    },
    {
      "id": "762207",
      "postDate": "03/03/2020 10:20:42",
      "content": "<p><a href=\"/cnzengshiyuan\">@cnzengshiyuan</a>, fastai2 does it right by default, I guess on fastai1 you would need to write a custom display function that can handle multiple labels.</p>",
      "rawMarkdown": "cnzengshiyuan, fastai2 does it right by default, I guess on fastai1 you would need to write a custom display function that can handle multiple labels.",
      "votes": null
    },
    {
      "id": "762970",
      "postDate": "03/04/2020 01:41:31",
      "content": "<p>Sorry for late reply, I call one_batch() and observe the labels are correct, so I take a batch of data to display, everything works well ! =)\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2F5ad21da6c3c1ba442ff26a03d50a577c%2FFixed.png?generation=1583290087883343&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Sorry for late reply, I call one_batch() and observe the labels are correct, so I take a batch of data to display, everything works well ! =)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2F5ad21da6c3c1ba442ff26a03d50a577c%2FFixed.png?generation=1583290087883343&amp;alt=media)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 718441,
      "author_name": "ipythonx",
      "author_url": "",
      "post_date": "01/14/2020 12:16:36",
      "content": "<p>Great work. Thanks for sharing. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 718803,
      "author_name": "maparla",
      "author_url": "",
      "post_date": "01/14/2020 19:59:31",
      "content": "<p>Hi! Thanks for sharing! I am new with fastai  (I usually use Pytorch but I have no time and I am playing for first time with fastai). I want to use SWA since people says that improve the results here but I am not able to find implementations on fastai, but yes at Pytorch... Do you know If there is a simple way? Same with Cutmix. Thanks!</p>",
      "votes": null,
      "replies": [
        {
          "id": 718911,
          "author_name": "mnpinto",
          "author_url": "",
          "post_date": "01/15/2020 00:14:14",
          "content": "<p>Take a look at callbacks in the documentation <a href=\"https://docs.fast.ai/callback.html\">https://docs.fast.ai/callback.html</a>. You can see the code for MixUp for example to have an idea how it works. This is for fastai v1 but for v2 the same applies but with other names.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 762167,
      "author_name": "cnzengshiyuan",
      "author_url": "",
      "post_date": "03/03/2020 09:23:48",
      "content": "<p>Sorry for disturbing you, as I use fastai1, I use data block to get data like below(learn from iafoss)\n<code>\n%%time\nstats = ([0.0692], [0.2051])\ndata = ( ImageList.from_df(train_labels, path='.', folder=TRAIN,\n                           suffix='.png', cols='image_id', convert_mode='L')\n        .split_by_rand_pct(0.2)\n        .label_from_df(cols=['grapheme_root', 'vowel_diacritic', 'consonant_diacritic'])\n        .transform(tfms, size=128)\n        .databunch(bs=16)\n        .normalize(stats)\n)\n</code>\nHowever, the labels didn't display correctly when I call show_batch(), can you hint me how to deal with it(display like y1;y2;y3 or your fastai2 notebook)? I have searched over the forum but seems gain nothing...\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fc2fef37567863516fb521bf00b77fd6e%2FDataBlockLabelMess.png?generation=1583227320316050&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 762207,
          "author_name": "mnpinto",
          "author_url": "",
          "post_date": "03/03/2020 10:20:42",
          "content": "<p><a href=\"/cnzengshiyuan\">@cnzengshiyuan</a>, fastai2 does it right by default, I guess on fastai1 you would need to write a custom display function that can handle multiple labels.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 762970,
          "author_name": "cnzengshiyuan",
          "author_url": "",
          "post_date": "03/04/2020 01:41:31",
          "content": "<p>Sorry for late reply, I call one_batch() and observe the labels are correct, so I take a batch of data to display, everything works well ! =)\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2F5ad21da6c3c1ba442ff26a03d50a577c%2FFixed.png?generation=1583290087883343&amp;alt=media\" alt=\"\"></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "718386": "I just shared this kernel featuring the new version of fastai :)\n\nhttps://www.kaggle.com/mnpinto/fastai2-starter-lb0-9598",
    "718441": "Great work. Thanks for sharing.",
    "718803": "Hi! Thanks for sharing! I am new with fastai  (I usually use Pytorch but I have no time and I am playing for first time with fastai). I want to use SWA since people says that improve the results here but I am not able to find implementations on fastai, but yes at Pytorch... Do you know If there is a simple way? Same with Cutmix. Thanks!",
    "718911": "Take a look at callbacks in the documentation https://docs.fast.ai/callback.html. You can see the code for MixUp for example to have an idea how it works. This is for fastai v1 but for v2 the same applies but with other names.",
    "762167": "Sorry for disturbing you, as I use fastai1, I use data block to get data like below(learn from iafoss)\n```\n%%time\nstats = ([0.0692], [0.2051])\ndata = ( ImageList.from_df(train_labels, path='.', folder=TRAIN,\n                           suffix='.png', cols='image_id', convert_mode='L')\n        .split_by_rand_pct(0.2)\n        .label_from_df(cols=['grapheme_root', 'vowel_diacritic', 'consonant_diacritic'])\n        .transform(tfms, size=128)\n        .databunch(bs=16)\n        .normalize(stats)\n)\n```\nHowever, the labels didn't display correctly when I call show_batch(), can you hint me how to deal with it(display like y1;y2;y3 or your fastai2 notebook)? I have searched over the forum but seems gain nothing...\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2Fc2fef37567863516fb521bf00b77fd6e%2FDataBlockLabelMess.png?generation=1583227320316050&amp;alt=media)",
    "762207": "cnzengshiyuan, fastai2 does it right by default, I guess on fastai1 you would need to write a custom display function that can handle multiple labels.",
    "762970": "Sorry for late reply, I call one_batch() and observe the labels are correct, so I take a batch of data to display, everything works well ! =)\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3149580%2F5ad21da6c3c1ba442ff26a03d50a577c%2FFixed.png?generation=1583290087883343&amp;alt=media)"
  },
  "source": "meta"
}