{
  "id": 411268,
  "title": "Can not install tflite-runtime in Kaggle kernel",
  "url": "/competitions/asl-fingerspelling/discussion/411268",
  "author_name": "Wondering Alice",
  "post_date": "2023-05-18T12:41:03.248000",
  "votes": 6,
  "comment_count": 11,
  "views": 0,
  "content": "<p>Hi all,</p>\n<p>In order to try and evaluate/debug TfLite models I ran the same code line as in the  previous competition:</p>\n<p>!pip install tflite-runtime</p>\n<p>(yes I checked that internet is on)</p>\n<p>and got the following error:</p>\n<p>ERROR: Could not find a version that satisfies the requirement tflite-runtime (from versions: none)<br>\nERROR: No matching distribution found for tflite-runtime</p>\n<p>Any suggestions? This worked fine before …</p>\n<p>Also, importing tensorflow (import tensorflow as tf) gives a version warning about scipy:</p>\n<p>/opt/conda/lib/python3.10/site-packages/scipy/<strong>init</strong>.py:146: UserWarning: A NumPy version &gt;=1.16.5 and &lt;1.23.0 is required for this version of SciPy (detected version 1.23.5\n  warnings.warn(f\"A NumPy version &gt;={np_minversion} and &lt;{np_maxversion}\"</p>\n<p>Since neither of these things occurred before, I am wondering whether an update was done to the Kaggle docker??<br>\nAnd if so: could there be an inconsistency between the result of calling </p>\n<p>converter = tf.lite.TFLiteConverter.from_keras_model(inference_model)</p>\n<p>and the required version of TfLite for this competition (TensorFlow Lite Runtime v2.9.1)?</p>",
  "messages": [
    {
      "id": 2264446,
      "postDate": "2023-05-18T12:41:03.250Z",
      "content": "<p>Hi all,</p>\n<p>In order to try and evaluate/debug TfLite models I ran the same code line as in the  previous competition:</p>\n<p>!pip install tflite-runtime</p>\n<p>(yes I checked that internet is on)</p>\n<p>and got the following error:</p>\n<p>ERROR: Could not find a version that satisfies the requirement tflite-runtime (from versions: none)<br>\nERROR: No matching distribution found for tflite-runtime</p>\n<p>Any suggestions? This worked fine before …</p>\n<p>Also, importing tensorflow (import tensorflow as tf) gives a version warning about scipy:</p>\n<p>/opt/conda/lib/python3.10/site-packages/scipy/<strong>init</strong>.py:146: UserWarning: A NumPy version &gt;=1.16.5 and &lt;1.23.0 is required for this version of SciPy (detected version 1.23.5\n  warnings.warn(f\"A NumPy version &gt;={np_minversion} and &lt;{np_maxversion}\"</p>\n<p>Since neither of these things occurred before, I am wondering whether an update was done to the Kaggle docker??<br>\nAnd if so: could there be an inconsistency between the result of calling </p>\n<p>converter = tf.lite.TFLiteConverter.from_keras_model(inference_model)</p>\n<p>and the required version of TfLite for this competition (TensorFlow Lite Runtime v2.9.1)?</p>",
      "rawMarkdown": "Hi all,\n\nIn order to try and evaluate/debug TfLite models I ran the same code line as in the  previous competition:\n\n!pip install tflite-runtime\n\n(yes I checked that internet is on)\n\nand got the following error:\n\nERROR: Could not find a version that satisfies the requirement tflite-runtime (from versions: none)\nERROR: No matching distribution found for tflite-runtime\n\nAny suggestions? This worked fine before ...\n\nAlso, importing tensorflow (import tensorflow as tf) gives a version warning about scipy:\n\n/opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5\n  warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n\n\nSince neither of these things occurred before, I am wondering whether an update was done to the Kaggle docker??\nAnd if so: could there be an inconsistency between the result of calling \n\nconverter = tf.lite.TFLiteConverter.from_keras_model(inference_model)\n\nand the required version of TfLite for this competition (TensorFlow Lite Runtime v2.9.1)?",
      "votes": 6
    },
    {
      "id": 2264792,
      "postDate": "2023-05-18T18:06:40.367Z",
      "content": "<p>the previous notebook had python version<br>\nPython 3.7.12</p>\n<p>this one has Python 3.10.10</p>",
      "rawMarkdown": "the previous notebook had python version\nPython 3.7.12\n\nthis one has Python 3.10.10",
      "votes": 3
    },
    {
      "id": 2269874,
      "postDate": "2023-05-22T19:09:13.380Z",
      "content": "<p><code>import tensorflow.lite as tflite</code></p>\n<p>should work. </p>",
      "rawMarkdown": "`import tensorflow.lite as tflite`\n\nshould work. ",
      "votes": 1
    },
    {
      "id": 2265318,
      "postDate": "2023-05-19T06:49:33.473Z",
      "content": "<p>I've investigated it a little bit and found that tflite-runtime-nightly is available for python3.10, but unfortunately, it raises an error during import. I guess this is due to the lack of some library. Hope, someone would continue investigating this and discover a way to fix it.</p>",
      "rawMarkdown": "I've investigated it a little bit and found that tflite-runtime-nightly is available for python3.10, but unfortunately, it raises an error during import. I guess this is due to the lack of some library. Hope, someone would continue investigating this and discover a way to fix it.",
      "votes": 1
    },
    {
      "id": 2268003,
      "postDate": "2023-05-21T11:37:57.823Z",
      "content": "<p>Hi all, </p>\n<p>I have shared a \"dummy model\" notebook with a pinned kernel version from the previous competition in the to show how TfLite inference can be done (can't put the link here since Kaggle doesn't let me share the url more than twice).</p>\n<p>Thanks for your help <a href=\"https://www.kaggle.com/meowmeowmeowmeowmeow\" target=\"_blank\">@meowmeowmeowmeowmeow</a> and <a href=\"https://www.kaggle.com/something4kag\" target=\"_blank\">@something4kag</a> </p>",
      "rawMarkdown": "Hi all, \n\nI have shared a \"dummy model\" notebook with a pinned kernel version from the previous competition in the to show how TfLite inference can be done (can't put the link here since Kaggle doesn't let me share the url more than twice).\n\nThanks for your help @meowmeowmeowmeowmeow and @something4kag "
    },
    {
      "id": 2267365,
      "postDate": "2023-05-20T20:13:06.150Z",
      "content": "<p>Hello;<br>\nI have the same problem and searching for all the weeken i think it is a windows issue ans there is a wheel file for linux try this<br>\n<a href=\"https://pypi.org/project/tflite-runtime/2.9.1/\" target=\"_blank\">https://pypi.org/project/tflite-runtime/2.9.1/</a><br>\nGood luck</p>",
      "rawMarkdown": "Hello;\nI have the same problem and searching for all the weeken i think it is a windows issue ans there is a wheel file for linux try this\nhttps://pypi.org/project/tflite-runtime/2.9.1/\nGood luck"
    },
    {
      "id": 2265337,
      "postDate": "2023-05-19T07:12:55.987Z",
      "content": "<p>You could try a notebook from the previous competition and do a Copy and Edit and leave Environment as Pin to original environment so you would retain older versions.  That way you could see if it all works ok for what you want to do in this competition.  If so you can work with that until issues around versions are resolved.  Be sure to remove the GISLR competition dataset, for submit it usually doesn't like more than one competition included.</p>",
      "rawMarkdown": "You could try a notebook from the previous competition and do a Copy and Edit and leave Environment as Pin to original environment so you would retain older versions.  That way you could see if it all works ok for what you want to do in this competition.  If so you can work with that until issues around versions are resolved.  Be sure to remove the GISLR competition dataset, for submit it usually doesn't like more than one competition included.",
      "replies": [
        {
          "id": 2267140,
          "postDate": "2023-05-20T16:12:38.850Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/something4kag\" target=\"_blank\">@something4kag</a> </p>\n<p>I'd be happy to try, but I don't know how I can copy a notebook from one competition to another while keeping the kernel settings … Could you clarify?</p>",
          "rawMarkdown": "Hi @something4kag \n\nI'd be happy to try, but I don't know how I can copy a notebook from one competition to another while keeping the kernel settings ... Could you clarify?",
          "replies": [
            {
              "id": 2267153,
              "postDate": "2023-05-20T16:22:46.207Z",
              "content": "<p>You could attach a competition dataset to forked notebook, thus making it a competition notebook.</p>",
              "rawMarkdown": "You could attach a competition dataset to forked notebook, thus making it a competition notebook.",
              "votes": 1
            },
            {
              "id": 2267655,
              "postDate": "2023-05-21T06:39:14.283Z",
              "content": "<p><a href=\"https://www.kaggle.com/wonderingalice\" target=\"_blank\">@wonderingalice</a> - if you have one of your own notebooks from the GISLR competition, open it and at the top next to Edit button are the 3 dots, click on them and the first choice is copy and edit. Select that and it will open a new Fork of … notebook.  The right panel should be open (if not use the arrow at the bottom of the slider to open it) and in the right panel section, scroll down to Notebook options, open it from collapse and you will see Environment.  Under Environment it will show Pin to original Environment and its date. The other option is always use latest which you do not want to select. So you do not have to do anything to keep it as the original Environment settings.   But at the top of the right panel under Data select +Add Data select competition dataset and get the competition data for ASL Fingerspelling, it should show in the list and click on the + to add it. Once added, under the existing Input there is the GISLR competition data that you want to remove.  Hover on the right side and three dots appear click on them for more actions and select remove.  You can keep, edit or remove whatever cells you want but you probably want to keep the code for class TFLiteModel(tf.Module) in the submission section. </p>\n<p>Update: use !pip install tflite-runtime==2.9.1 <br>\nor whatever version you want that works here, above does install ok. From the evaluation page </p>\n<blockquote>\n  <p>compatible with the TensorFlow Lite Runtime v2.9.1 </p>\n</blockquote>\n<p>Or use one of the public notebooks from the GISLR competition open it and at the top is the Copy and Edit button. Use that and the rest of above is the same.</p>\n<p>If you create a new notebook in this competition it is setting the Pin to original Environment for the date you create it. But you can always change that to use latest if you want later.  </p>",
              "rawMarkdown": "@wonderingalice - if you have one of your own notebooks from the GISLR competition, open it and at the top next to Edit button are the 3 dots, click on them and the first choice is copy and edit. Select that and it will open a new Fork of ... notebook.  The right panel should be open (if not use the arrow at the bottom of the slider to open it) and in the right panel section, scroll down to Notebook options, open it from collapse and you will see Environment.  Under Environment it will show Pin to original Environment and its date. The other option is always use latest which you do not want to select. So you do not have to do anything to keep it as the original Environment settings.   But at the top of the right panel under Data select +Add Data select competition dataset and get the competition data for ASL Fingerspelling, it should show in the list and click on the + to add it. Once added, under the existing Input there is the GISLR competition data that you want to remove.  Hover on the right side and three dots appear click on them for more actions and select remove.  You can keep, edit or remove whatever cells you want but you probably want to keep the code for class TFLiteModel(tf.Module) in the submission section. \n\nUpdate: use !pip install tflite-runtime==2.9.1 \nor whatever version you want that works here, above does install ok. From the evaluation page \n>compatible with the TensorFlow Lite Runtime v2.9.1 \n\nOr use one of the public notebooks from the GISLR competition open it and at the top is the Copy and Edit button. Use that and the rest of above is the same.\n\nIf you create a new notebook in this competition it is setting the Pin to original Environment for the date you create it. But you can always change that to use latest if you want later.  ",
              "votes": 1
            }
          ]
        }
      ]
    },
    {
      "id": 2264789,
      "postDate": "2023-05-18T17:58:43.997Z",
      "content": "<p>hey, did you figure this out. also have the same issue</p>",
      "rawMarkdown": "hey, did you figure this out. also have the same issue",
      "replies": [
        {
          "id": 2269875,
          "postDate": "2023-05-22T19:09:43.077Z",
          "content": "<p><code>import tensorflow.lite as tflite</code>  try this. I think tflite is included in the package for 3.10</p>",
          "rawMarkdown": "`import tensorflow.lite as tflite`  try this. I think tflite is included in the package for 3.10"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2264792,
      "author_name": "Jon",
      "author_url": "",
      "post_date": "2023-05-18T18:06:40.367000",
      "content": "<p>the previous notebook had python version<br>\nPython 3.7.12</p>\n<p>this one has Python 3.10.10</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 2269874,
      "author_name": "Andrew",
      "author_url": "",
      "post_date": "2023-05-22T19:09:13.380000",
      "content": "<p><code>import tensorflow.lite as tflite</code></p>\n<p>should work. </p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2265318,
      "author_name": "Mykola",
      "author_url": "",
      "post_date": "2023-05-19T06:49:33.473000",
      "content": "<p>I've investigated it a little bit and found that tflite-runtime-nightly is available for python3.10, but unfortunately, it raises an error during import. I guess this is due to the lack of some library. Hope, someone would continue investigating this and discover a way to fix it.</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2268003,
      "author_name": "Wondering Alice",
      "author_url": "",
      "post_date": "2023-05-21T11:37:57.823000",
      "content": "<p>Hi all, </p>\n<p>I have shared a \"dummy model\" notebook with a pinned kernel version from the previous competition in the to show how TfLite inference can be done (can't put the link here since Kaggle doesn't let me share the url more than twice).</p>\n<p>Thanks for your help <a href=\"https://www.kaggle.com/meowmeowmeowmeowmeow\" target=\"_blank\">@meowmeowmeowmeowmeow</a> and <a href=\"https://www.kaggle.com/something4kag\" target=\"_blank\">@something4kag</a> </p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2267365,
      "author_name": "YERMES AMINE",
      "author_url": "",
      "post_date": "2023-05-20T20:13:06.150000",
      "content": "<p>Hello;<br>\nI have the same problem and searching for all the weeken i think it is a windows issue ans there is a wheel file for linux try this<br>\n<a href=\"https://pypi.org/project/tflite-runtime/2.9.1/\" target=\"_blank\">https://pypi.org/project/tflite-runtime/2.9.1/</a><br>\nGood luck</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2265337,
      "author_name": "something4kag",
      "author_url": "",
      "post_date": "2023-05-19T07:12:55.987000",
      "content": "<p>You could try a notebook from the previous competition and do a Copy and Edit and leave Environment as Pin to original environment so you would retain older versions.  That way you could see if it all works ok for what you want to do in this competition.  If so you can work with that until issues around versions are resolved.  Be sure to remove the GISLR competition dataset, for submit it usually doesn't like more than one competition included.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2267140,
          "author_name": "Wondering Alice",
          "author_url": "",
          "post_date": "2023-05-20T16:12:38.850000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/something4kag\" target=\"_blank\">@something4kag</a> </p>\n<p>I'd be happy to try, but I don't know how I can copy a notebook from one competition to another while keeping the kernel settings … Could you clarify?</p>",
          "votes": 0,
          "replies": [
            {
              "id": 2267153,
              "author_name": "Mykola",
              "author_url": "",
              "post_date": "2023-05-20T16:22:46.207000",
              "content": "<p>You could attach a competition dataset to forked notebook, thus making it a competition notebook.</p>",
              "votes": 1,
              "replies": []
            },
            {
              "id": 2267655,
              "author_name": "something4kag",
              "author_url": "",
              "post_date": "2023-05-21T06:39:14.283000",
              "content": "<p><a href=\"https://www.kaggle.com/wonderingalice\" target=\"_blank\">@wonderingalice</a> - if you have one of your own notebooks from the GISLR competition, open it and at the top next to Edit button are the 3 dots, click on them and the first choice is copy and edit. Select that and it will open a new Fork of … notebook.  The right panel should be open (if not use the arrow at the bottom of the slider to open it) and in the right panel section, scroll down to Notebook options, open it from collapse and you will see Environment.  Under Environment it will show Pin to original Environment and its date. The other option is always use latest which you do not want to select. So you do not have to do anything to keep it as the original Environment settings.   But at the top of the right panel under Data select +Add Data select competition dataset and get the competition data for ASL Fingerspelling, it should show in the list and click on the + to add it. Once added, under the existing Input there is the GISLR competition data that you want to remove.  Hover on the right side and three dots appear click on them for more actions and select remove.  You can keep, edit or remove whatever cells you want but you probably want to keep the code for class TFLiteModel(tf.Module) in the submission section. </p>\n<p>Update: use !pip install tflite-runtime==2.9.1 <br>\nor whatever version you want that works here, above does install ok. From the evaluation page </p>\n<blockquote>\n  <p>compatible with the TensorFlow Lite Runtime v2.9.1 </p>\n</blockquote>\n<p>Or use one of the public notebooks from the GISLR competition open it and at the top is the Copy and Edit button. Use that and the rest of above is the same.</p>\n<p>If you create a new notebook in this competition it is setting the Pin to original Environment for the date you create it. But you can always change that to use latest if you want later.  </p>",
              "votes": 1,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2264789,
      "author_name": "Jon",
      "author_url": "",
      "post_date": "2023-05-18T17:58:43.997000",
      "content": "<p>hey, did you figure this out. also have the same issue</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2269875,
          "author_name": "Andrew",
          "author_url": "",
          "post_date": "2023-05-22T19:09:43.077000",
          "content": "<p><code>import tensorflow.lite as tflite</code>  try this. I think tflite is included in the package for 3.10</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2264446": "Hi all,\n\nIn order to try and evaluate/debug TfLite models I ran the same code line as in the  previous competition:\n\n!pip install tflite-runtime\n\n(yes I checked that internet is on)\n\nand got the following error:\n\nERROR: Could not find a version that satisfies the requirement tflite-runtime (from versions: none)\nERROR: No matching distribution found for tflite-runtime\n\nAny suggestions? This worked fine before ...\n\nAlso, importing tensorflow (import tensorflow as tf) gives a version warning about scipy:\n\n/opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.5\n  warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n\n\nSince neither of these things occurred before, I am wondering whether an update was done to the Kaggle docker??\nAnd if so: could there be an inconsistency between the result of calling \n\nconverter = tf.lite.TFLiteConverter.from_keras_model(inference_model)\n\nand the required version of TfLite for this competition (TensorFlow Lite Runtime v2.9.1)?",
    "2264792": "the previous notebook had python version\nPython 3.7.12\n\nthis one has Python 3.10.10",
    "2269874": "`import tensorflow.lite as tflite`\n\nshould work. ",
    "2265318": "I've investigated it a little bit and found that tflite-runtime-nightly is available for python3.10, but unfortunately, it raises an error during import. I guess this is due to the lack of some library. Hope, someone would continue investigating this and discover a way to fix it.",
    "2268003": "Hi all, \n\nI have shared a \"dummy model\" notebook with a pinned kernel version from the previous competition in the to show how TfLite inference can be done (can't put the link here since Kaggle doesn't let me share the url more than twice).\n\nThanks for your help @meowmeowmeowmeowmeow and @something4kag ",
    "2267365": "Hello;\nI have the same problem and searching for all the weeken i think it is a windows issue ans there is a wheel file for linux try this\nhttps://pypi.org/project/tflite-runtime/2.9.1/\nGood luck",
    "2265337": "You could try a notebook from the previous competition and do a Copy and Edit and leave Environment as Pin to original environment so you would retain older versions.  That way you could see if it all works ok for what you want to do in this competition.  If so you can work with that until issues around versions are resolved.  Be sure to remove the GISLR competition dataset, for submit it usually doesn't like more than one competition included.",
    "2264789": "hey, did you figure this out. also have the same issue"
  }
}