Skip to main content

CLI Utility for interacting with coach

Project description

Coach CLI

This utility is responsible for managing user interaction with Coach's services.

Specifically you can:

  • Sync local training data with remote
  • Start and watch training sessions
  • Locally evaluate models
  • Download models

Installation

pip3 install -U coach-cli

To do anything we must be logged in

coach login
API Key: *****
Storage Key: *****
Storage Key Secret: *****

Usage

Usage: coach [OPTIONS] COMMAND [ARGS]...

  💖 Welcome to the Coach CLI Utility! 💖

  Grab your API keys and view example usage at:
  https://coach.lkuich.com

  Happy training! ⚽

Options:
  --help  Show this message and exit.

Commands:
  cache     Caches a model locally.
  download  Downloads remote training data locally.  
  login     Authenticates with Coach.
  ls        Lists synced projects in Coach.
  new       Uploads your local training directory to Coach.
  predict   Locally runs model prediction on specified image.
  rm        Deletes synced training data.
  status    Retreives the status of models.
  sync      Syncs a local data directory with Coach.
  train     Starts a Coach training session.

Examples

We're going to train a flowers dataset to recognise the following subjects:

  • daisy
  • dandelion
  • roses
  • sunflowers
  • tulips

Start by downloading and extracting our dataset

wget https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
tar -xvf flower_photos.tgz
mv flower_photos flowers # Our model's going to be called flowers

Note the structure of the dataset, this is important as it defines both the model and label names

flowers
    |-daisy
        |-10090824183_d02c613f10_m.jpg
        |-17040847367_b54d05bf52.jpg
        |-...
    |-dandelion
    |-roses
    |-sunflowers
    |-tulips

Now we're going to upload our dataset to Coach

coach new flowers

Note, if you make changes to this dataset, like delete some samples, you can sync your local directory with Coach by running

coach sync flowers

Now we're going to train. We must specify the name of our synced project, the number of training steps, and the base module to use for transfer learning.
It's typically best to start high with training steps. The default is 5000, and will do fine for this example. We're going to use the default mobilenet_v2_100_224 as our base model, since this gives us a decent tradeoff between final model size, speed, and quality. Make sure to consult the help docs to find our more about supported base modules and find the right fit for your model based on your needs.

coach train flowers
# OR: coach train flowers --steps 5000 --module mobilenet_v2_100_224

This will start a new training session. You can monitor its progress with the status command, by default with no arguments it'll show the status of all models. Since we're just interested in our flowers model, well run with the --model parameter

coach status --model flowers
-----------------------------------------------------
flowers     |    Training   |     2019-06-15 14:30:20
-----------------------------------------------------

Once complete, your status should look something like this

coach status --model flowers
-----------------------------------------------------
flowers     |    Completed   |    2019-06-15 14:32:00
-----------------------------------------------------

Now we can download and run our model locally on some training data

coach cache flowers # Only have to run once
coach predict flowers/roses/13342823005_16d3df58df_n.jpg flowers
{ roses: 0.90, tulips: 0.05, sunflowers: 0.03, daisy: 0.01, dandelion: 0.01 }

Our cached model is stored in:
~/.coach/models/flowers

Conclusions

That's all it takes to train a model end-to-end!

For implementation, check out our client side SDK's:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coach-cli-0.92.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

coach_cli-0.92-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file coach-cli-0.92.tar.gz.

File metadata

  • Download URL: coach-cli-0.92.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for coach-cli-0.92.tar.gz
Algorithm Hash digest
SHA256 9a81b54d1ac3322da2407798516aeddc5830689b5ed6ac29cecc893d828ad4a8
MD5 80ece256789c70bd0f4e9eb5930cf448
BLAKE2b-256 a567b45de2e2fae101a957e86b26c0d646f03a8ab4b716f75eb84e9d767f250a

See more details on using hashes here.

File details

Details for the file coach_cli-0.92-py3-none-any.whl.

File metadata

  • Download URL: coach_cli-0.92-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for coach_cli-0.92-py3-none-any.whl
Algorithm Hash digest
SHA256 936b86b6ca05a0c74f9aec0ee2fdd30eb0c778a5cd5d70efeda1a23508c85a0f
MD5 227a4be0ef4251601785da488be00d7d
BLAKE2b-256 132ac5c35ac9b965e607d5fe24faf0cb1857fde91ebdf081b6aae7676ceacd25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page