{
  "id": 306195,
  "title": "Error while importing tensorflow today",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/306195",
  "author_name": "",
  "post_date": "2022-02-08T13:28:45.079921100Z",
  "votes": 1,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Hi, after cloning the TF object detection api following the steps in the official tutorial:<br>\n<a href=\"https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md\" target=\"_blank\">https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md</a></p>\n<p>I get errors when trying to simply import tensorflow:<br>\nimport tensorflow as tf<br>\nI usually get the following error:<br>\n\"module compiled against API version 0xe but this version of numpy is 0xd\"</p>\n<p>I tried installing kera sand tensorflow 2.6.0 and then I get a different error when importing tf:<br>\nmodule 'pyparsing' has no attribute 'downcaseTokens'</p>\n<p>This didn't happen some weeks ago, and notebooks with environments from weeks ago don't run into this problem, but if I select to use the latest environment on the notebook settings, I'll get the error.</p>\n<p>Can someone help me please? I've been stuck with this all day</p>",
  "messages": [
    {
      "id": "1681439",
      "postDate": "02/08/2022 13:28:45",
      "content": "<p>Hi, after cloning the TF object detection api following the steps in the official tutorial:<br>\n<a href=\"https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md\" target=\"_blank\">https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md</a></p>\n<p>I get errors when trying to simply import tensorflow:<br>\nimport tensorflow as tf<br>\nI usually get the following error:<br>\n\"module compiled against API version 0xe but this version of numpy is 0xd\"</p>\n<p>I tried installing kera sand tensorflow 2.6.0 and then I get a different error when importing tf:<br>\nmodule 'pyparsing' has no attribute 'downcaseTokens'</p>\n<p>This didn't happen some weeks ago, and notebooks with environments from weeks ago don't run into this problem, but if I select to use the latest environment on the notebook settings, I'll get the error.</p>\n<p>Can someone help me please? I've been stuck with this all day</p>",
      "rawMarkdown": "Hi, after cloning the TF object detection api following the steps in the official tutorial:\nhttps://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md\n\nI get errors when trying to simply import tensorflow:\nimport tensorflow as tf\nI usually get the following error:\n\"module compiled against API version 0xe but this version of numpy is 0xd\"\n\nI tried installing kera sand tensorflow 2.6.0 and then I get a different error when importing tf:\nmodule 'pyparsing' has no attribute 'downcaseTokens'\n\nThis didn't happen some weeks ago, and notebooks with environments from weeks ago don't run into this problem, but if I select to use the latest environment on the notebook settings, I'll get the error.\n\nCan someone help me please? I've been stuck with this all day",
      "votes": null
    },
    {
      "id": "1681466",
      "postDate": "02/08/2022 13:47:36",
      "content": "<p>Hi, have you tried upgrading numpy? I think that might do the trick.<br>\npip install numpy --upgrade</p>",
      "rawMarkdown": "Hi, have you tried upgrading numpy? I think that might do the trick.\npip install numpy --upgrade",
      "votes": null
    },
    {
      "id": "1681468",
      "postDate": "02/08/2022 13:48:34",
      "content": "<p>Yes, it doesn't work. </p>",
      "rawMarkdown": "Yes, it doesn't work.",
      "votes": null
    },
    {
      "id": "1681514",
      "postDate": "02/08/2022 14:15:43",
      "content": "<p>I replicated your error on colab and solved it by running:</p>\n<p>!pip install numpy --upgrade --ignore-installed</p>\n<p>Then restarting the runtime.</p>\n<p>Hope it helps!</p>",
      "rawMarkdown": "I replicated your error on colab and solved it by running:\n\n!pip install numpy --upgrade --ignore-installed\n\nThen restarting the runtime.\n\nHope it helps!",
      "votes": null
    },
    {
      "id": "1681519",
      "postDate": "02/08/2022 14:23:09",
      "content": "<p>Thanks, I managed to fix it on colab as well, but I keep getting the pyparser error on kaggle notebooks. Well, I guess I'll have to work on colab then.</p>\n<p>Thanks for your help ^^</p>",
      "rawMarkdown": "Thanks, I managed to fix it on colab as well, but I keep getting the pyparser error on kaggle notebooks. Well, I guess I'll have to work on colab then.\n\nThanks for your help ^^",
      "votes": null
    },
    {
      "id": "1681542",
      "postDate": "02/08/2022 14:46:57",
      "content": "<p>Ok, I used<br>\n<code>import os\nos.kill(os.getpid(), 9)</code><br>\nTo restart the runtime on the kaggle notebook as well, and I can import tensorflow now.</p>",
      "rawMarkdown": "Ok, I used\n`import os\nos.kill(os.getpid(), 9)`\nTo restart the runtime on the kaggle notebook as well, and I can import tensorflow now.",
      "votes": null
    },
    {
      "id": "1681589",
      "postDate": "02/08/2022 15:12:36",
      "content": "<p>Glad it worked out for you ;)</p>",
      "rawMarkdown": "Glad it worked out for you ;)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1681466,
      "author_name": "dauriel",
      "author_url": "",
      "post_date": "02/08/2022 13:47:36",
      "content": "<p>Hi, have you tried upgrading numpy? I think that might do the trick.<br>\npip install numpy --upgrade</p>",
      "votes": null,
      "replies": [
        {
          "id": 1681468,
          "author_name": "ricardfos",
          "author_url": "",
          "post_date": "02/08/2022 13:48:34",
          "content": "<p>Yes, it doesn't work. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1681514,
          "author_name": "dauriel",
          "author_url": "",
          "post_date": "02/08/2022 14:15:43",
          "content": "<p>I replicated your error on colab and solved it by running:</p>\n<p>!pip install numpy --upgrade --ignore-installed</p>\n<p>Then restarting the runtime.</p>\n<p>Hope it helps!</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1681519,
          "author_name": "ricardfos",
          "author_url": "",
          "post_date": "02/08/2022 14:23:09",
          "content": "<p>Thanks, I managed to fix it on colab as well, but I keep getting the pyparser error on kaggle notebooks. Well, I guess I'll have to work on colab then.</p>\n<p>Thanks for your help ^^</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1681542,
          "author_name": "ricardfos",
          "author_url": "",
          "post_date": "02/08/2022 14:46:57",
          "content": "<p>Ok, I used<br>\n<code>import os\nos.kill(os.getpid(), 9)</code><br>\nTo restart the runtime on the kaggle notebook as well, and I can import tensorflow now.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1681589,
          "author_name": "dauriel",
          "author_url": "",
          "post_date": "02/08/2022 15:12:36",
          "content": "<p>Glad it worked out for you ;)</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1681439": "Hi, after cloning the TF object detection api following the steps in the official tutorial:\nhttps://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md\n\nI get errors when trying to simply import tensorflow:\nimport tensorflow as tf\nI usually get the following error:\n\"module compiled against API version 0xe but this version of numpy is 0xd\"\n\nI tried installing kera sand tensorflow 2.6.0 and then I get a different error when importing tf:\nmodule 'pyparsing' has no attribute 'downcaseTokens'\n\nThis didn't happen some weeks ago, and notebooks with environments from weeks ago don't run into this problem, but if I select to use the latest environment on the notebook settings, I'll get the error.\n\nCan someone help me please? I've been stuck with this all day",
    "1681466": "Hi, have you tried upgrading numpy? I think that might do the trick.\npip install numpy --upgrade",
    "1681468": "Yes, it doesn't work.",
    "1681514": "I replicated your error on colab and solved it by running:\n\n!pip install numpy --upgrade --ignore-installed\n\nThen restarting the runtime.\n\nHope it helps!",
    "1681519": "Thanks, I managed to fix it on colab as well, but I keep getting the pyparser error on kaggle notebooks. Well, I guess I'll have to work on colab then.\n\nThanks for your help ^^",
    "1681542": "Ok, I used\n`import os\nos.kill(os.getpid(), 9)`\nTo restart the runtime on the kaggle notebook as well, and I can import tensorflow now.",
    "1681589": "Glad it worked out for you ;)"
  },
  "source": "meta"
}