{
  "id": 130215,
  "title": "TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'",
  "url": "/competitions/flower-classification-with-tpus/discussion/130215",
  "author_name": "",
  "post_date": "2020-02-12T19:11:34.147312400Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Did anyone face this problem? </p>\n\n<p>```\nimport tensorflow as tf</p>\n\n<h1>detect and init the TPU</h1>\n\n<p>tpu = tf.distribute.cluster_resolver.TPUClusterResolver()\ntf.config.experimental_connect_to_cluster(tpu)\ntf.tpu.experimental.initialize_tpu_system(tpu)</p>\n\n<h1>instantiate a distribution strategy</h1>\n\n<p>tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)</p>\n\n<p>with tpu_strategy.scope():\n    model = dense()</p>\n\n<pre><code># compiling    \nmodel.compile()\n</code></pre>\n\n<hr>\n\n<p>TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'</p>\n\n<p>```</p>",
  "messages": [
    {
      "id": "744366",
      "postDate": "02/12/2020 19:11:34",
      "content": "<p>Did anyone face this problem? </p>\n\n<p>```\nimport tensorflow as tf</p>\n\n<h1>detect and init the TPU</h1>\n\n<p>tpu = tf.distribute.cluster_resolver.TPUClusterResolver()\ntf.config.experimental_connect_to_cluster(tpu)\ntf.tpu.experimental.initialize_tpu_system(tpu)</p>\n\n<h1>instantiate a distribution strategy</h1>\n\n<p>tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)</p>\n\n<p>with tpu_strategy.scope():\n    model = dense()</p>\n\n<pre><code># compiling    \nmodel.compile()\n</code></pre>\n\n<hr>\n\n<p>TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'</p>\n\n<p>```</p>",
      "rawMarkdown": "Did anyone face this problem? \n\n```\nimport tensorflow as tf\n\n# detect and init the TPU\ntpu = tf.distribute.cluster_resolver.TPUClusterResolver()\ntf.config.experimental_connect_to_cluster(tpu)\ntf.tpu.experimental.initialize_tpu_system(tpu)\n\n# instantiate a distribution strategy\ntpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)\n\nwith tpu_strategy.scope():\n    model = dense()\n    \n    # compiling    \n    model.compile()\n\n\n---------------------------------------------------------------------------\nTypeError: unsupported operand type(s) for *: 'int' and 'NoneType'\n\n```",
      "votes": null
    },
    {
      "id": "744377",
      "postDate": "02/12/2020 19:22:09",
      "content": "<p><a href=\"/martingorner\">@martingorner</a> </p>",
      "rawMarkdown": "martingorner",
      "votes": null
    },
    {
      "id": "744388",
      "postDate": "02/12/2020 19:35:10",
      "content": "<p>Cannot tell without looking at your <code>dense()</code> function. The error message looks quite explicit though: multiplying an int and nothing is bad.</p>",
      "rawMarkdown": "Cannot tell without looking at your `dense()` function. The error message looks quite explicit though: multiplying an int and nothing is bad.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 744377,
      "author_name": "ipythonx",
      "author_url": "",
      "post_date": "02/12/2020 19:22:09",
      "content": "<p><a href=\"/martingorner\">@martingorner</a> </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 744388,
      "author_name": "mgorner",
      "author_url": "",
      "post_date": "02/12/2020 19:35:10",
      "content": "<p>Cannot tell without looking at your <code>dense()</code> function. The error message looks quite explicit though: multiplying an int and nothing is bad.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "744366": "Did anyone face this problem? \n\n```\nimport tensorflow as tf\n\n# detect and init the TPU\ntpu = tf.distribute.cluster_resolver.TPUClusterResolver()\ntf.config.experimental_connect_to_cluster(tpu)\ntf.tpu.experimental.initialize_tpu_system(tpu)\n\n# instantiate a distribution strategy\ntpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)\n\nwith tpu_strategy.scope():\n    model = dense()\n    \n    # compiling    \n    model.compile()\n\n\n---------------------------------------------------------------------------\nTypeError: unsupported operand type(s) for *: 'int' and 'NoneType'\n\n```",
    "744377": "martingorner",
    "744388": "Cannot tell without looking at your `dense()` function. The error message looks quite explicit though: multiplying an int and nothing is bad."
  },
  "source": "meta"
}