{
  "id": 294767,
  "title": "Help needed with Tensorflow Object Detection API",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/294767",
  "author_name": "",
  "post_date": "2021-12-12T15:19:42.578909200Z",
  "votes": 1,
  "comment_count": 9,
  "views": 0,
  "content": "<p>Hello everyone! Newbie Kaggler here,<br>\nThis is my first competition and I'm trying to make use of TensorFlow Object Detection API to make predictions. I'm mainly using <a href=\"https://www.kaggle.com/khanhlvg/cots-detection-w-tensorflow-object-detection-api\" target=\"_blank\">this Kaggle notebook</a> as a starting point in particular.</p>\n<p>However, after installing TensorFlow(2.6.0 as suggested by the author of the above notebook) and TF Object Detection API, I'm encountering the following error when importing TensorFlow after turning on the GPU mode:<br>\n<em>AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'</em></p>\n<p><a href=\"https://www.kaggle.com/adnanpen/tensorflow-object-detection-api\" target=\"_blank\">Here's the link to my notebook</a><br>\nI tried running the original notebook from the author above in the \"copy and edit\" and it works perfectly fine! I think there must be some issue relating to environments!??<br>\nAny help solving this issue will be highly appreciated 🙏 🙏 </p>",
  "messages": [
    {
      "id": "1615694",
      "postDate": "12/12/2021 15:19:42",
      "content": "<p>Hello everyone! Newbie Kaggler here,<br>\nThis is my first competition and I'm trying to make use of TensorFlow Object Detection API to make predictions. I'm mainly using <a href=\"https://www.kaggle.com/khanhlvg/cots-detection-w-tensorflow-object-detection-api\" target=\"_blank\">this Kaggle notebook</a> as a starting point in particular.</p>\n<p>However, after installing TensorFlow(2.6.0 as suggested by the author of the above notebook) and TF Object Detection API, I'm encountering the following error when importing TensorFlow after turning on the GPU mode:<br>\n<em>AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'</em></p>\n<p><a href=\"https://www.kaggle.com/adnanpen/tensorflow-object-detection-api\" target=\"_blank\">Here's the link to my notebook</a><br>\nI tried running the original notebook from the author above in the \"copy and edit\" and it works perfectly fine! I think there must be some issue relating to environments!??<br>\nAny help solving this issue will be highly appreciated 🙏 🙏 </p>",
      "rawMarkdown": "Hello everyone! Newbie Kaggler here,\nThis is my first competition and I'm trying to make use of TensorFlow Object Detection API to make predictions. I'm mainly using [this Kaggle notebook](https://www.kaggle.com/khanhlvg/cots-detection-w-tensorflow-object-detection-api) as a starting point in particular.\n\nHowever, after installing TensorFlow(2.6.0 as suggested by the author of the above notebook) and TF Object Detection API, I'm encountering the following error when importing TensorFlow after turning on the GPU mode:\n*AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'*\n\n[Here's the link to my notebook](https://www.kaggle.com/adnanpen/tensorflow-object-detection-api)\nI tried running the original notebook from the author above in the \"copy and edit\" and it works perfectly fine! I think there must be some issue relating to environments!??\nAny help solving this issue will be highly appreciated 🙏 🙏",
      "votes": null
    },
    {
      "id": "1619657",
      "postDate": "12/16/2021 05:11:34",
      "content": "<p>nothing there in your notebook.</p>",
      "rawMarkdown": "nothing there in your notebook.",
      "votes": null
    },
    {
      "id": "1620954",
      "postDate": "12/17/2021 09:31:11",
      "content": "<p>Sorry, I'm not sure what you're trying to say!?<br>\nHere's <a href=\"https://www.kaggle.com/adnanpen/tensorflow-object-detection-api\" target=\"_blank\">the link</a> to my notebook.</p>",
      "rawMarkdown": "Sorry, I'm not sure what you're trying to say!?\nHere's [the link](https://www.kaggle.com/adnanpen/tensorflow-object-detection-api) to my notebook.",
      "votes": null
    },
    {
      "id": "1621386",
      "postDate": "12/17/2021 17:00:41",
      "content": "<p>for unknow reason, when I replied I saw nothing at the link for script/notebook UI.</p>\n<p>also I remember that the original notebook not using TF2.6, though there is some lines commented out for TF2.6.</p>\n<p>also that the original notebook checkout some specific tag.</p>",
      "rawMarkdown": "for unknow reason, when I replied I saw nothing at the link for script/notebook UI.\n\nalso I remember that the original notebook not using TF2.6, though there is some lines commented out for TF2.6.\n\nalso that the original notebook checkout some specific tag.",
      "votes": null
    },
    {
      "id": "1622927",
      "postDate": "12/19/2021 09:34:33",
      "content": "<p>I tried running my notebook using both the versions of TensorFlow (2.6.0 &amp; 2.6.2) and both these versions output the same error when importing them. I've also noticed that this error only shows up after installing and configuring the Object detection API else the tf import works as usual.<br>\nIf I proceed with the install and configure step after the tf import then the Object Detection API doesn't utilise the GPU😣</p>\n<p>I think the main culprit here is with the environment and package dependencies.<br>\nHope it gets fixed in the next environment update.</p>",
      "rawMarkdown": "I tried running my notebook using both the versions of TensorFlow (2.6.0 & 2.6.2) and both these versions output the same error when importing them. I've also noticed that this error only shows up after installing and configuring the Object detection API else the tf import works as usual.\nIf I proceed with the install and configure step after the tf import then the Object Detection API doesn't utilise the GPU😣\n\nI think the main culprit here is with the environment and package dependencies.\nHope it gets fixed in the next environment update.",
      "votes": null
    },
    {
      "id": "1649247",
      "postDate": "01/14/2022 05:47:57",
      "content": "<p>I had the same issue. To solve it, what I did was:</p>\n<ol>\n<li><p>Run the cell below: <br>\npip install pyparsing==2.4.7</p></li>\n<li><p>Restart the kernel</p></li>\n<li><p>Rerun all relevant cells</p></li>\n</ol>",
      "rawMarkdown": "I had the same issue. To solve it, what I did was:\n\n1. Run the cell below: \npip install pyparsing==2.4.7\n\n2. Restart the kernel\n\n3. Rerun all relevant cells",
      "votes": null
    },
    {
      "id": "1651504",
      "postDate": "01/15/2022 20:06:10",
      "content": "<p>I'm also facing the same problem. The possible reason - the stable environment was upgraded to 2022-1-10 version. I wonder how it can be fixed.</p>",
      "rawMarkdown": "I'm also facing the same problem. The possible reason - the stable environment was upgraded to 2022-1-10 version. I wonder how it can be fixed.",
      "votes": null
    },
    {
      "id": "1651506",
      "postDate": "01/15/2022 20:06:37",
      "content": "<p>When you restart the kernel, doesn't that reset your environment (on Kaggle)?</p>",
      "rawMarkdown": "When you restart the kernel, doesn't that reset your environment (on Kaggle)?",
      "votes": null
    },
    {
      "id": "1651516",
      "postDate": "01/15/2022 20:17:04",
      "content": "<p>I found the solution! Just add <code>!pip install httplib2&gt;=0.20.2</code> after TF Object Detection API and before <code>import tensorflow as tf</code>.</p>",
      "rawMarkdown": "I found the solution! Just add `!pip install httplib2>=0.20.2` after TF Object Detection API and before `import tensorflow as tf`.",
      "votes": null
    },
    {
      "id": "1651579",
      "postDate": "01/15/2022 21:25:04",
      "content": "<p>Thanks, this worked for me</p>",
      "rawMarkdown": "Thanks, this worked for me",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1619657,
      "author_name": "dragonzhang",
      "author_url": "",
      "post_date": "12/16/2021 05:11:34",
      "content": "<p>nothing there in your notebook.</p>",
      "votes": null,
      "replies": [
        {
          "id": 1620954,
          "author_name": "adnanpen",
          "author_url": "",
          "post_date": "12/17/2021 09:31:11",
          "content": "<p>Sorry, I'm not sure what you're trying to say!?<br>\nHere's <a href=\"https://www.kaggle.com/adnanpen/tensorflow-object-detection-api\" target=\"_blank\">the link</a> to my notebook.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1621386,
          "author_name": "dragonzhang",
          "author_url": "",
          "post_date": "12/17/2021 17:00:41",
          "content": "<p>for unknow reason, when I replied I saw nothing at the link for script/notebook UI.</p>\n<p>also I remember that the original notebook not using TF2.6, though there is some lines commented out for TF2.6.</p>\n<p>also that the original notebook checkout some specific tag.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1622927,
          "author_name": "adnanpen",
          "author_url": "",
          "post_date": "12/19/2021 09:34:33",
          "content": "<p>I tried running my notebook using both the versions of TensorFlow (2.6.0 &amp; 2.6.2) and both these versions output the same error when importing them. I've also noticed that this error only shows up after installing and configuring the Object detection API else the tf import works as usual.<br>\nIf I proceed with the install and configure step after the tf import then the Object Detection API doesn't utilise the GPU😣</p>\n<p>I think the main culprit here is with the environment and package dependencies.<br>\nHope it gets fixed in the next environment update.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1649247,
      "author_name": "adrianfischer",
      "author_url": "",
      "post_date": "01/14/2022 05:47:57",
      "content": "<p>I had the same issue. To solve it, what I did was:</p>\n<ol>\n<li><p>Run the cell below: <br>\npip install pyparsing==2.4.7</p></li>\n<li><p>Restart the kernel</p></li>\n<li><p>Rerun all relevant cells</p></li>\n</ol>",
      "votes": null,
      "replies": [
        {
          "id": 1651506,
          "author_name": "atamazian",
          "author_url": "",
          "post_date": "01/15/2022 20:06:37",
          "content": "<p>When you restart the kernel, doesn't that reset your environment (on Kaggle)?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1651579,
          "author_name": "matthiasdermutz",
          "author_url": "",
          "post_date": "01/15/2022 21:25:04",
          "content": "<p>Thanks, this worked for me</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1651504,
      "author_name": "atamazian",
      "author_url": "",
      "post_date": "01/15/2022 20:06:10",
      "content": "<p>I'm also facing the same problem. The possible reason - the stable environment was upgraded to 2022-1-10 version. I wonder how it can be fixed.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1651516,
      "author_name": "atamazian",
      "author_url": "",
      "post_date": "01/15/2022 20:17:04",
      "content": "<p>I found the solution! Just add <code>!pip install httplib2&gt;=0.20.2</code> after TF Object Detection API and before <code>import tensorflow as tf</code>.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1615694": "Hello everyone! Newbie Kaggler here,\nThis is my first competition and I'm trying to make use of TensorFlow Object Detection API to make predictions. I'm mainly using [this Kaggle notebook](https://www.kaggle.com/khanhlvg/cots-detection-w-tensorflow-object-detection-api) as a starting point in particular.\n\nHowever, after installing TensorFlow(2.6.0 as suggested by the author of the above notebook) and TF Object Detection API, I'm encountering the following error when importing TensorFlow after turning on the GPU mode:\n*AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'*\n\n[Here's the link to my notebook](https://www.kaggle.com/adnanpen/tensorflow-object-detection-api)\nI tried running the original notebook from the author above in the \"copy and edit\" and it works perfectly fine! I think there must be some issue relating to environments!??\nAny help solving this issue will be highly appreciated 🙏 🙏",
    "1619657": "nothing there in your notebook.",
    "1620954": "Sorry, I'm not sure what you're trying to say!?\nHere's [the link](https://www.kaggle.com/adnanpen/tensorflow-object-detection-api) to my notebook.",
    "1621386": "for unknow reason, when I replied I saw nothing at the link for script/notebook UI.\n\nalso I remember that the original notebook not using TF2.6, though there is some lines commented out for TF2.6.\n\nalso that the original notebook checkout some specific tag.",
    "1622927": "I tried running my notebook using both the versions of TensorFlow (2.6.0 & 2.6.2) and both these versions output the same error when importing them. I've also noticed that this error only shows up after installing and configuring the Object detection API else the tf import works as usual.\nIf I proceed with the install and configure step after the tf import then the Object Detection API doesn't utilise the GPU😣\n\nI think the main culprit here is with the environment and package dependencies.\nHope it gets fixed in the next environment update.",
    "1649247": "I had the same issue. To solve it, what I did was:\n\n1. Run the cell below: \npip install pyparsing==2.4.7\n\n2. Restart the kernel\n\n3. Rerun all relevant cells",
    "1651504": "I'm also facing the same problem. The possible reason - the stable environment was upgraded to 2022-1-10 version. I wonder how it can be fixed.",
    "1651506": "When you restart the kernel, doesn't that reset your environment (on Kaggle)?",
    "1651516": "I found the solution! Just add `!pip install httplib2>=0.20.2` after TF Object Detection API and before `import tensorflow as tf`.",
    "1651579": "Thanks, this worked for me"
  },
  "source": "meta"
}