Skip to content

Commit

Permalink
Use deprecated dependency resolver for tflite_model_maker
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 388291294
  • Loading branch information
MarkDaoust authored and copybara-github committed Aug 2, 2021
1 parent 77e6d1b commit 0fac45f
Showing 1 changed file with 40 additions and 30 deletions.
70 changes: 40 additions & 30 deletions examples/colab/cropnet_on_device.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,10 @@
"id": "3XX46cTrh6iD"
},
"source": [
"Copyright 2021 The TensorFlow Hub Authors.\n",
"##### Copyright 2021 The TensorFlow Hub Authors. \n",
"Licensed under the Apache License, Version 2.0 (the \"License\");"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "hk5u_9KN1m-t"
},
"source": [
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/hub/tutorials/cropnet_on_device\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/hub/blob/master/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/hub/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://tfhub.dev/s?module-type=image-feature-vector\u0026q=cropnet\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/hub_logo_32px.png\" /\u003eSee TF Hub models\u003c/a\u003e\n",
" \u003c/td\u003e\n",
"\u003c/table\u003e"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -43,7 +18,7 @@
},
"outputs": [],
"source": [
"# Copyright 2021 The TensorFlow Hub Authors. All Rights Reserved.\n",
"#@title Copyright 2021 The TensorFlow Hub Authors. All Rights Reserved.\n",
"#\n",
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
Expand All @@ -67,14 +42,48 @@
"source": [
"# Fine tuning models for plant disease detection\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "hk5u_9KN1m-t"
},
"source": [
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/hub/tutorials/cropnet_on_device\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/hub/blob/master/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/hub/examples/colab/cropnet_on_device.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://tfhub.dev/s?module-type=image-feature-vector\u0026q=cropnet\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/hub_logo_32px.png\" /\u003eSee TF Hub models\u003c/a\u003e\n",
" \u003c/td\u003e\n",
"\u003c/table\u003e"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "OEHq-hV5sWYO"
},
"source": [
"This notebook shows you how to **fine-tune CropNet models from TensorFlow Hub** on a dataset from TFDS or your own crop disease detection dataset.\n",
"\n",
"You will:\n",
"- Load the TFDS cassava dataset or your own data\n",
"- Enrich the data with unknown (negative) examples to get a more robust model\n",
"- Apply image augmentations to the data\n",
"- Load and fine tune a [CropNet model](https://tfhub.dev/s?module-type=image-feature-vector\u0026q=cropnet) from TF Hub\n",
"- Export a TFLite model, ready to be deployed on your app with [Task Library](https://www.tensorflow.org/lite/inference_with_metadata/task_library/image_classifier), [MLKit](https://developers.google.com/ml-kit/vision/image-labeling/custom-models/android) or [TFLite](https://www.tensorflow.org/lite/guide/inference) directly\n"
"- Export a TFLite model, ready to be deployed on your app with [Task Library](https://www.tensorflow.org/lite/inference_with_metadata/task_library/image_classifier), [MLKit](https://developers.google.com/ml-kit/vision/image-labeling/custom-models/android) or [TFLite](https://www.tensorflow.org/lite/guide/inference) directly"
]
},
{
Expand All @@ -96,8 +105,8 @@
},
"outputs": [],
"source": [
"!pip install -q tflite-model-maker\n",
"!pip install -q -U tensorflow-datasets"
"!pip install --use-deprecated=legacy-resolver tflite-model-maker\n",
"!pip install -U tensorflow-datasets"
]
},
{
Expand Down Expand Up @@ -692,6 +701,7 @@
"accelerator": "GPU",
"colab": {
"collapsed_sections": [
"3XX46cTrh6iD",
"xDuDGUAxyHtA"
],
"name": "CropNet: Fine tuning models for plant disease detection",
Expand Down

0 comments on commit 0fac45f

Please sign in to comment.