Part 7: Summary
Now you know how to prepare training data, create a model, train that model, and load it back in for testing. To get set up as quickly as possible on new projects, I’ve created a full project template in TensorPlates.
Creating a New Project
To start a new project simply do the following:
git clone git@github.com:crosleythomas/tensorplates.git
cp -r tensorplates/project <your project directory>
Tip: After creating a new project you can make your life easier by creating an alias inside your .bash_profile
to activate the associate virtual environment and cd to that directory. For example, say you have a project called flowers and have created a virtual environment called env
inside the project directory.
##################################
### Inside ~/.bash_profile ###
##################################
alias flowers='cd ~/Documents/projects/flowers && source env/bin/activate'
Project Implementation Checklist
Now, you can step through completing your project with this checklist:
- Setup
Copy project structure
Gather new dataset
Create or activate virtual environment - Data Preparation
Load data
Define output file(s) structure
Define parse_fn - Data Loading
Get paths to TFRecords
Define Dataset’s map parse function - Model
Define any additionalconfig
parameters
Make sure runtime parameters make sense for your current system (i.e.num_parallel_calls
indataset.map
,buffer_size
indataset.shuffle
)
Implement model_fn
Defineparams
- Training
- Training/Evaluation loop is already defined is the template
You should only need to defineparams.train_epochs
- Training/Evaluation loop is already defined is the template
- Evaluation
Mountmodel_dir
if running remotely
Open TensorBoard and Watch - Deploy
This one is completely up to you!
Continue Reading
Part 8 cites the tutorials I found most helpful and other resources you may want to use.