{
  "id": 190857,
  "title": "Problems importing Tensorflow",
  "url": "/competitions/predict-volcanic-eruptions-ingv-oe/discussion/190857",
  "author_name": "",
  "post_date": "2020-10-13T16:06:56.679592800Z",
  "votes": 2,
  "comment_count": 7,
  "views": 0,
  "content": "<p>I had a problem importing Tensorflow, which seems related to the path, or to the TF version (some people solved it by downgrading to TF version 1.14). Just wanted to know if other people had the same issue. It seems odd, anyway. </p>\n<p>Here is the error :</p>\n<p><code>KeyError: \"Registering two gradient with name 'Pack'! (Previous registration was in register /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/registry.py:66)\"</code></p>\n<p>Does someone have any idea about this ? </p>",
  "messages": [
    {
      "id": "1048580",
      "postDate": "10/13/2020 16:06:56",
      "content": "<p>I had a problem importing Tensorflow, which seems related to the path, or to the TF version (some people solved it by downgrading to TF version 1.14). Just wanted to know if other people had the same issue. It seems odd, anyway. </p>\n<p>Here is the error :</p>\n<p><code>KeyError: \"Registering two gradient with name 'Pack'! (Previous registration was in register /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/registry.py:66)\"</code></p>\n<p>Does someone have any idea about this ? </p>",
      "rawMarkdown": "I had a problem importing Tensorflow, which seems related to the path, or to the TF version (some people solved it by downgrading to TF version 1.14). Just wanted to know if other people had the same issue. It seems odd, anyway. \n\nHere is the error :\n\n`KeyError: \"Registering two gradient with name 'Pack'! (Previous registration was in register /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/registry.py:66)\"`\n\nDoes someone have any idea about this ?",
      "votes": null
    },
    {
      "id": "1048598",
      "postDate": "10/13/2020 16:22:07",
      "content": "<p><a href=\"https://www.kaggle.com/catadanna\" target=\"_blank\">@catadanna</a> Try out this code, it seemed to work for me.<br>\nimport warnings<br>\nwarnings.filterwarnings(\"ignore\")<br>\nimport tensorflow as tf</p>",
      "rawMarkdown": "catadanna Try out this code, it seemed to work for me.\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport tensorflow as tf",
      "votes": null
    },
    {
      "id": "1048618",
      "postDate": "10/13/2020 16:47:00",
      "content": "<p>Thank you for your answer, but it is an error, not a simple warning. A warning allows the program to continue but an error stops it. </p>",
      "rawMarkdown": "Thank you for your answer, but it is an error, not a simple warning. A warning allows the program to continue but an error stops it.",
      "votes": null
    },
    {
      "id": "1048629",
      "postDate": "10/13/2020 17:02:53",
      "content": "<p>I seem to have no error…kindly see the attached image<br>\nI have not changed any settings… Just a new notebook and imported it…</p>",
      "rawMarkdown": "I seem to have no error...kindly see the attached image\nI have not changed any settings... Just a new notebook and imported it...",
      "votes": null
    },
    {
      "id": "1048652",
      "postDate": "10/13/2020 17:25:00",
      "content": "<p>I think you forgot to attach the image :-)</p>",
      "rawMarkdown": "I think you forgot to attach the image :-)",
      "votes": null
    },
    {
      "id": "1048866",
      "postDate": "10/13/2020 21:47:20",
      "content": "<p>Did you try TF 2.0 + Python 3.8? <br>\nI recommend 2 options:</p>\n<ol>\n<li>Downgrade to TF 1.14.0</li>\n<li>Upgrade TF, CUDA, Python to the latest versions</li>\n</ol>",
      "rawMarkdown": "Did you try TF 2.0 + Python 3.8? \nI recommend 2 options:\n1. Downgrade to TF 1.14.0\n2. Upgrade TF, CUDA, Python to the latest versions",
      "votes": null
    },
    {
      "id": "1048876",
      "postDate": "10/13/2020 22:13:32",
      "content": "<p>Thank you, that is the solution given on Github too, there are several issues on the subject. It worked finally, I had to create a new notebook. </p>\n<p>I work on a Kaggle notebook, the best settings must have been done already; that is why I hesitated changing the versions.</p>",
      "rawMarkdown": "Thank you, that is the solution given on Github too, there are several issues on the subject. It worked finally, I had to create a new notebook. \n\nI work on a Kaggle notebook, the best settings must have been done already; that is why I hesitated changing the versions.",
      "votes": null
    },
    {
      "id": "1052936",
      "postDate": "10/18/2020 12:50:34",
      "content": "<p>Try to uninstall TF in conda, and install it again using pip. Or, just create new conda env and install the package needed 👍 </p>",
      "rawMarkdown": "Try to uninstall TF in conda, and install it again using pip. Or, just create new conda env and install the package needed 👍",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1048598,
      "author_name": "thegreatcoder",
      "author_url": "",
      "post_date": "10/13/2020 16:22:07",
      "content": "<p><a href=\"https://www.kaggle.com/catadanna\" target=\"_blank\">@catadanna</a> Try out this code, it seemed to work for me.<br>\nimport warnings<br>\nwarnings.filterwarnings(\"ignore\")<br>\nimport tensorflow as tf</p>",
      "votes": null,
      "replies": [
        {
          "id": 1048618,
          "author_name": "catadanna",
          "author_url": "",
          "post_date": "10/13/2020 16:47:00",
          "content": "<p>Thank you for your answer, but it is an error, not a simple warning. A warning allows the program to continue but an error stops it. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1048629,
          "author_name": "thegreatcoder",
          "author_url": "",
          "post_date": "10/13/2020 17:02:53",
          "content": "<p>I seem to have no error…kindly see the attached image<br>\nI have not changed any settings… Just a new notebook and imported it…</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1048652,
          "author_name": "catadanna",
          "author_url": "",
          "post_date": "10/13/2020 17:25:00",
          "content": "<p>I think you forgot to attach the image :-)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1048866,
      "author_name": "coffeeshop",
      "author_url": "",
      "post_date": "10/13/2020 21:47:20",
      "content": "<p>Did you try TF 2.0 + Python 3.8? <br>\nI recommend 2 options:</p>\n<ol>\n<li>Downgrade to TF 1.14.0</li>\n<li>Upgrade TF, CUDA, Python to the latest versions</li>\n</ol>",
      "votes": null,
      "replies": [
        {
          "id": 1048876,
          "author_name": "catadanna",
          "author_url": "",
          "post_date": "10/13/2020 22:13:32",
          "content": "<p>Thank you, that is the solution given on Github too, there are several issues on the subject. It worked finally, I had to create a new notebook. </p>\n<p>I work on a Kaggle notebook, the best settings must have been done already; that is why I hesitated changing the versions.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1052936,
      "author_name": "bantalmetal",
      "author_url": "",
      "post_date": "10/18/2020 12:50:34",
      "content": "<p>Try to uninstall TF in conda, and install it again using pip. Or, just create new conda env and install the package needed 👍 </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1048580": "I had a problem importing Tensorflow, which seems related to the path, or to the TF version (some people solved it by downgrading to TF version 1.14). Just wanted to know if other people had the same issue. It seems odd, anyway. \n\nHere is the error :\n\n`KeyError: \"Registering two gradient with name 'Pack'! (Previous registration was in register /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/registry.py:66)\"`\n\nDoes someone have any idea about this ?",
    "1048598": "catadanna Try out this code, it seemed to work for me.\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport tensorflow as tf",
    "1048618": "Thank you for your answer, but it is an error, not a simple warning. A warning allows the program to continue but an error stops it.",
    "1048629": "I seem to have no error...kindly see the attached image\nI have not changed any settings... Just a new notebook and imported it...",
    "1048652": "I think you forgot to attach the image :-)",
    "1048866": "Did you try TF 2.0 + Python 3.8? \nI recommend 2 options:\n1. Downgrade to TF 1.14.0\n2. Upgrade TF, CUDA, Python to the latest versions",
    "1048876": "Thank you, that is the solution given on Github too, there are several issues on the subject. It worked finally, I had to create a new notebook. \n\nI work on a Kaggle notebook, the best settings must have been done already; that is why I hesitated changing the versions.",
    "1052936": "Try to uninstall TF in conda, and install it again using pip. Or, just create new conda env and install the package needed 👍"
  },
  "source": "meta"
}