{
  "id": 132644,
  "title": "[solved]fastai cutout can't work",
  "url": "/competitions/bengaliai-cv19/discussion/132644",
  "author_name": "",
  "post_date": "2020-02-27T03:51:34.245721500Z",
  "votes": null,
  "comment_count": 7,
  "views": 0,
  "content": "<p><code>\ninit_tfm = get_transforms(do_flip=False, max_warp=0.1)\n__cutout = RandTransform(cutout, kwargs={'n_holes': 3}, p=0.6)\ninit_tfm[0].append(__cutout)\n</code>\nwithout the __cutout added to the tfm, everything works well. After adding it, I got this\n<code>\nException: It's not possible to apply those transforms to your dataset:\n uniform_int() missing 1 required positional argument: 'high'\n</code>\nAnd I looked the source of cutout, there is not a arg named 'high', is there any solution? The uniform_int() needs low and high as its args, but how can I pass them?</p>",
  "messages": [
    {
      "id": "757730",
      "postDate": "02/27/2020 03:51:34",
      "content": "<p><code>\ninit_tfm = get_transforms(do_flip=False, max_warp=0.1)\n__cutout = RandTransform(cutout, kwargs={'n_holes': 3}, p=0.6)\ninit_tfm[0].append(__cutout)\n</code>\nwithout the __cutout added to the tfm, everything works well. After adding it, I got this\n<code>\nException: It's not possible to apply those transforms to your dataset:\n uniform_int() missing 1 required positional argument: 'high'\n</code>\nAnd I looked the source of cutout, there is not a arg named 'high', is there any solution? The uniform_int() needs low and high as its args, but how can I pass them?</p>",
      "rawMarkdown": "```\ninit_tfm = get_transforms(do_flip=False, max_warp=0.1)\n__cutout = RandTransform(cutout, kwargs={'n_holes': 3}, p=0.6)\ninit_tfm[0].append(__cutout)\n```\nwithout the __cutout added to the tfm, everything works well. After adding it, I got this\n```\nException: It's not possible to apply those transforms to your dataset:\n uniform_int() missing 1 required positional argument: 'high'\n```\nAnd I looked the source of cutout, there is not a arg named 'high', is there any solution? The uniform_int() needs low and high as its args, but how can I pass them?",
      "votes": null
    },
    {
      "id": "758547",
      "postDate": "02/27/2020 22:33:19",
      "content": "<p>Try this: <code>get_transforms(do_flip=False, max_warp=0.1, xtra_tfms=[RandTransform(tfm=cutout, kwargs={'n_holes': (3, 3)})]</code></p>",
      "rawMarkdown": "Try this: `get_transforms(do_flip=False, max_warp=0.1, xtra_tfms=[RandTransform(tfm=cutout, kwargs={'n_holes': (3, 3)})]`",
      "votes": null
    },
    {
      "id": "758598",
      "postDate": "02/28/2020 00:43:05",
      "content": "<p>Amazing!! =) Thanks a lot! It works, but why should pass a tuple instead of a int? Does you get hint from the source of cutout?</p>",
      "rawMarkdown": "Amazing!! =) Thanks a lot! It works, but why should pass a tuple instead of a int? Does you get hint from the source of cutout?",
      "votes": null
    },
    {
      "id": "759240",
      "postDate": "02/28/2020 19:06:32",
      "content": "<p>It's because the argument type is <code>uniform_int</code>, which means it's drawing a random number between <code>(low, high)</code>. That's why the error you were getting said that you were missing <code>high</code>.</p>",
      "rawMarkdown": "It's because the argument type is `uniform_int`, which means it's drawing a random number between `(low, high)`. That's why the error you were getting said that you were missing `high`.",
      "votes": null
    },
    {
      "id": "759382",
      "postDate": "02/29/2020 00:57:31",
      "content": "<p>You can try this tool: <a href=\"https://github.com/jcgrundy/sprinkles\">https://github.com/jcgrundy/sprinkles</a></p>",
      "rawMarkdown": "You can try this tool: https://github.com/jcgrundy/sprinkles",
      "votes": null
    },
    {
      "id": "759416",
      "postDate": "02/29/2020 02:23:33",
      "content": "<p>Thank you very much! :)</p>",
      "rawMarkdown": "Thank you very much! :)",
      "votes": null
    },
    {
      "id": "759417",
      "postDate": "02/29/2020 02:24:23",
      "content": "<p>It looks good👍 , I will try it. Thanks a lot!</p>",
      "rawMarkdown": "It looks good👍 , I will try it. Thanks a lot!",
      "votes": null
    },
    {
      "id": "782125",
      "postDate": "03/22/2020 00:24:11",
      "content": "<p>Thanks for the solution and explanation, just ran into the same issue.</p>",
      "rawMarkdown": "Thanks for the solution and explanation, just ran into the same issue.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 758547,
      "author_name": "marktenenholtz",
      "author_url": "",
      "post_date": "02/27/2020 22:33:19",
      "content": "<p>Try this: <code>get_transforms(do_flip=False, max_warp=0.1, xtra_tfms=[RandTransform(tfm=cutout, kwargs={'n_holes': (3, 3)})]</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 758598,
          "author_name": "cnzengshiyuan",
          "author_url": "",
          "post_date": "02/28/2020 00:43:05",
          "content": "<p>Amazing!! =) Thanks a lot! It works, but why should pass a tuple instead of a int? Does you get hint from the source of cutout?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 759240,
          "author_name": "marktenenholtz",
          "author_url": "",
          "post_date": "02/28/2020 19:06:32",
          "content": "<p>It's because the argument type is <code>uniform_int</code>, which means it's drawing a random number between <code>(low, high)</code>. That's why the error you were getting said that you were missing <code>high</code>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 759416,
          "author_name": "cnzengshiyuan",
          "author_url": "",
          "post_date": "02/29/2020 02:23:33",
          "content": "<p>Thank you very much! :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 782125,
          "author_name": "schorsi",
          "author_url": "",
          "post_date": "03/22/2020 00:24:11",
          "content": "<p>Thanks for the solution and explanation, just ran into the same issue.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 759382,
      "author_name": "mnikita",
      "author_url": "",
      "post_date": "02/29/2020 00:57:31",
      "content": "<p>You can try this tool: <a href=\"https://github.com/jcgrundy/sprinkles\">https://github.com/jcgrundy/sprinkles</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 759417,
          "author_name": "cnzengshiyuan",
          "author_url": "",
          "post_date": "02/29/2020 02:24:23",
          "content": "<p>It looks good👍 , I will try it. Thanks a lot!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "757730": "```\ninit_tfm = get_transforms(do_flip=False, max_warp=0.1)\n__cutout = RandTransform(cutout, kwargs={'n_holes': 3}, p=0.6)\ninit_tfm[0].append(__cutout)\n```\nwithout the __cutout added to the tfm, everything works well. After adding it, I got this\n```\nException: It's not possible to apply those transforms to your dataset:\n uniform_int() missing 1 required positional argument: 'high'\n```\nAnd I looked the source of cutout, there is not a arg named 'high', is there any solution? The uniform_int() needs low and high as its args, but how can I pass them?",
    "758547": "Try this: `get_transforms(do_flip=False, max_warp=0.1, xtra_tfms=[RandTransform(tfm=cutout, kwargs={'n_holes': (3, 3)})]`",
    "758598": "Amazing!! =) Thanks a lot! It works, but why should pass a tuple instead of a int? Does you get hint from the source of cutout?",
    "759240": "It's because the argument type is `uniform_int`, which means it's drawing a random number between `(low, high)`. That's why the error you were getting said that you were missing `high`.",
    "759382": "You can try this tool: https://github.com/jcgrundy/sprinkles",
    "759416": "Thank you very much! :)",
    "759417": "It looks good👍 , I will try it. Thanks a lot!",
    "782125": "Thanks for the solution and explanation, just ran into the same issue."
  },
  "source": "meta"
}