This is a Guild AI example that defines a CIFAR10 model based on TensorFlow's excellent Convolutional Neural Networks Guide.
- Guild - Guild project file (more info)
- samples.py - Implementation of the samples resource
- single.py - Training script for single GPU
- support.py - Shared code across training scripts
- upstream_single.py - Wrapper to train using the original TensorFlow (upstream) script for single GPU
To work with this project, ensure that you have Guild AI installed along with its requirements.
If you haven't already, clone Guild AI examples:
$ git clone https://github.com/guildai/guild-examples.git
Prepare and train the CIFAR10 model:
$ cd guild-examples/cifar10
$ guild prepare
$ guild train
The prepare
command downloads the CIFAR10 data, which will be used
for subsequent operations.
At any point you can view project run results by in Guild
View by running the
view
command in a separate terminal:
$ guild view
Guild View runs on port 6333
by default — to view it,
open http://localhost:6333 in your browser.
To calculate the most recently trained model's final accuracy using
test data, use the evaluate
command:
$ guild evaluate --latest-run
To run a model as an HTTP service in Guild Serve run:
$ guild serve RUN
where RUN
is a value returned by list-runs
(i.e. a path to the run
directory) or --latest-run
to serve the model exported in the last
run.
This example provides a samples
resource that can be used to
generate a number of CIFAR10 images and their corresponding JSON
encodings. These file can be used to run ad hoc inference on the model
in Guild View (see the Serve tab) or Guild Serve
(see Serving above).
Images are generated from the CIFAR10 training/test data.
To generate samples, run:
$ guild prepare samples
This will create a local samples
subdirectory containing the samples
images.
For more information about the Guild AI project, see https://guild.ai.