From 8d16240b346fd0dccad59213ed0c2d3e94bb221e Mon Sep 17 00:00:00 2001 From: Daniel Situnayake Date: Thu, 5 Dec 2019 17:09:12 -0800 Subject: [PATCH] Fixes for magic_wand training scripts PiperOrigin-RevId: 284086588 Change-Id: Ie571601516848f4c4fc9f3658ef7aea9d9842232 --- .../experimental/micro/examples/magic_wand/README.md | 6 ++++++ .../magic_wand/train/train_magic_wand_model.ipynb | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tensorflow/lite/experimental/micro/examples/magic_wand/README.md b/tensorflow/lite/experimental/micro/examples/magic_wand/README.md index bf095fd4018..3f97b9d85ae 100644 --- a/tensorflow/lite/experimental/micro/examples/magic_wand/README.md +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/README.md @@ -15,6 +15,7 @@ then outputs the gesture to the serial port. - [Deploy to SparkFun Edge](#deploy-to-sparkfun-edge) - [Deploy to Adafruit devices](#deploy-to-adafruit) - [Run the tests on a development machine](#run-the-tests-on-a-development-machine) +- [Train your own model](#train-your-own-model) ## Deploy to Arduino @@ -360,3 +361,8 @@ To understand how TensorFlow Lite does this, you can look at the source in It's a fairly small amount of code that creates an interpreter, gets a handle to a model that's been compiled into the program, and then invokes the interpreter with the model and sample inputs. + +## Train your own model + +To train your own model, or create a new model for a new set of gestures, +follow the instructions in [magic_wand/train/README.md](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/magic_wand/train/README.md). diff --git a/tensorflow/lite/experimental/micro/examples/magic_wand/train/train_magic_wand_model.ipynb b/tensorflow/lite/experimental/micro/examples/magic_wand/train/train_magic_wand_model.ipynb index f501d474e3d..1995ef02dc3 100644 --- a/tensorflow/lite/experimental/micro/examples/magic_wand/train/train_magic_wand_model.ipynb +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/train/train_magic_wand_model.ipynb @@ -63,9 +63,9 @@ "colab_type": "text" }, "source": [ - "## Install dependencies\n", + "## Configure dependencies\n", "\n", - "Run the following cell to ensure the required dependencies are installed." + "Run the following cell to ensure the correct version of TensorFlow is used." ] }, { @@ -76,8 +76,7 @@ "colab": {} }, "source": [ - "!pip uninstall -y tensorflow\n", - "!pip install -q tensorflow-gpu==2.0.0-beta1" + "%tensorflow_version 2.x\n" ], "execution_count": 0, "outputs": [] @@ -103,7 +102,7 @@ "# Clone the repository from GitHub\n", "!git clone --depth 1 -q https://github.com/tensorflow/tensorflow\n", "# Copy the training scripts into our workspace\n", - "!cp -r tensorflow/tensorflow/lite/experimental/micro/magic_wand/train train" + "!cp -r tensorflow/tensorflow/lite/experimental/micro/examples/magic_wand/train train" ], "execution_count": 0, "outputs": []