{
  "id": 303958,
  "title": "non_max_suppression() Got an Unexpected Keyword Argument 'merge'",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/303958",
  "author_name": "Dino Wun",
  "post_date": "2022-01-30T09:24:03.150000",
  "votes": 1,
  "comment_count": 0,
  "views": 0,
  "content": "<p>After this problem I solved, (<a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567)\" target=\"_blank\">https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567)</a>, there are more problems I faced. </p>\n<p>When I was testing over train images, over the code cell here:</p>\n<pre><code>ir = f'{DATASET_PATH}'\nimgs = [dir + f for f in ('video_1/4775.jpg', 'video_0/9794.jpg', 'video_0/4502.jpg', 'video_0/9651.jpg', 'video_0/9700.jpg',  'video_0/9674.jpg','video_0/20.jpg', 'video_0/17.jpg', 'video_1/5474.jpg',)]\n\nfor fileimg in imgs:\n    img = cv2.imread(fileimg)\n    bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n    display(show_prediction(img, bboxes, scores))\n</code></pre>\n<p>I got an error saying:</p>\n<pre><code>---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_39/1178746378.py in &lt;module&gt;\n      5 for fileimg in imgs:\n      6     img = cv2.imread(fileimg)\n----&gt; 7     bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n      8     display(show_prediction(img, bboxes, scores))\n\n/tmp/ipykernel_39/4120915292.py in predict_img(model2, img_in, img_size, conf_thres, iou_thres, device)\n     31 \n     32     if pred is not None:\n---&gt; 33         pred = non_max_suppression(pred, conf_thres=conf_thres, iou_thres=iou_thres, merge=False, classes=None, agnostic=False)\n     34 \n     35     for i, det in enumerate(pred):\n\nTypeError: non_max_suppression() got an unexpected keyword argument 'merge'\n</code></pre>\n<p>Can you help me fix this error which said that the non_max_suppression function got an unexpected keyword argument, 'merge'?</p>",
  "messages": [
    {
      "id": 1669028,
      "postDate": "2022-01-30T09:24:03.150Z",
      "content": "<p>After this problem I solved, (<a href=\"https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567)\" target=\"_blank\">https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567)</a>, there are more problems I faced. </p>\n<p>When I was testing over train images, over the code cell here:</p>\n<pre><code>ir = f'{DATASET_PATH}'\nimgs = [dir + f for f in ('video_1/4775.jpg', 'video_0/9794.jpg', 'video_0/4502.jpg', 'video_0/9651.jpg', 'video_0/9700.jpg',  'video_0/9674.jpg','video_0/20.jpg', 'video_0/17.jpg', 'video_1/5474.jpg',)]\n\nfor fileimg in imgs:\n    img = cv2.imread(fileimg)\n    bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n    display(show_prediction(img, bboxes, scores))\n</code></pre>\n<p>I got an error saying:</p>\n<pre><code>---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_39/1178746378.py in &lt;module&gt;\n      5 for fileimg in imgs:\n      6     img = cv2.imread(fileimg)\n----&gt; 7     bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n      8     display(show_prediction(img, bboxes, scores))\n\n/tmp/ipykernel_39/4120915292.py in predict_img(model2, img_in, img_size, conf_thres, iou_thres, device)\n     31 \n     32     if pred is not None:\n---&gt; 33         pred = non_max_suppression(pred, conf_thres=conf_thres, iou_thres=iou_thres, merge=False, classes=None, agnostic=False)\n     34 \n     35     for i, det in enumerate(pred):\n\nTypeError: non_max_suppression() got an unexpected keyword argument 'merge'\n</code></pre>\n<p>Can you help me fix this error which said that the non_max_suppression function got an unexpected keyword argument, 'merge'?</p>",
      "rawMarkdown": "After this problem I solved, (https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567), there are more problems I faced. \n\nWhen I was testing over train images, over the code cell here:\n```\nir = f'{DATASET_PATH}'\nimgs = [dir + f for f in ('video_1/4775.jpg', 'video_0/9794.jpg', 'video_0/4502.jpg', 'video_0/9651.jpg', 'video_0/9700.jpg',  'video_0/9674.jpg','video_0/20.jpg', 'video_0/17.jpg', 'video_1/5474.jpg',)]\n\nfor fileimg in imgs:\n    img = cv2.imread(fileimg)\n    bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n    display(show_prediction(img, bboxes, scores))\n```\nI got an error saying:\n```\n---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_39/1178746378.py in <module>\n      5 for fileimg in imgs:\n      6     img = cv2.imread(fileimg)\n----> 7     bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n      8     display(show_prediction(img, bboxes, scores))\n\n/tmp/ipykernel_39/4120915292.py in predict_img(model2, img_in, img_size, conf_thres, iou_thres, device)\n     31 \n     32     if pred is not None:\n---> 33         pred = non_max_suppression(pred, conf_thres=conf_thres, iou_thres=iou_thres, merge=False, classes=None, agnostic=False)\n     34 \n     35     for i, det in enumerate(pred):\n\nTypeError: non_max_suppression() got an unexpected keyword argument 'merge'\n```\n\nCan you help me fix this error which said that the non_max_suppression function got an unexpected keyword argument, 'merge'?",
      "votes": 1
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1669028": "After this problem I solved, (https://www.kaggle.com/c/tensorflow-great-barrier-reef/discussion/303567), there are more problems I faced. \n\nWhen I was testing over train images, over the code cell here:\n```\nir = f'{DATASET_PATH}'\nimgs = [dir + f for f in ('video_1/4775.jpg', 'video_0/9794.jpg', 'video_0/4502.jpg', 'video_0/9651.jpg', 'video_0/9700.jpg',  'video_0/9674.jpg','video_0/20.jpg', 'video_0/17.jpg', 'video_1/5474.jpg',)]\n\nfor fileimg in imgs:\n    img = cv2.imread(fileimg)\n    bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n    display(show_prediction(img, bboxes, scores))\n```\nI got an error saying:\n```\n---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_39/1178746378.py in <module>\n      5 for fileimg in imgs:\n      6     img = cv2.imread(fileimg)\n----> 7     bboxes, scores, classes = predict_img(model2, img, img_size, conf_thres = CONF, iou_thres = IOU, device = device)\n      8     display(show_prediction(img, bboxes, scores))\n\n/tmp/ipykernel_39/4120915292.py in predict_img(model2, img_in, img_size, conf_thres, iou_thres, device)\n     31 \n     32     if pred is not None:\n---> 33         pred = non_max_suppression(pred, conf_thres=conf_thres, iou_thres=iou_thres, merge=False, classes=None, agnostic=False)\n     34 \n     35     for i, det in enumerate(pred):\n\nTypeError: non_max_suppression() got an unexpected keyword argument 'merge'\n```\n\nCan you help me fix this error which said that the non_max_suppression function got an unexpected keyword argument, 'merge'?"
  }
}