Intent
- Overview of Tensorflow internals
- Tensorflow Hub
- Show how to run Tensorflow models in Go
- MobileNetv2 101
- Bonus: better Tensorflow builds
Tensorflow terminology
- Tensor
- Variable
- Constant
- Operation
- Graph
- Session
- Device
Tensorflow binaries
- CPU
- GPU=CUDA
- OpenCL
- TPU*
- Custom
Default CPU builds lack SSE and AVX.
Building Tensorflow
- Bazel - Python
- Bazel - dynamic, C API
- autotools - static, no GPU, no C API
~40 minutes on i7-7500U (2x2 threads) laptop.
Tensorflow binaries for Go
cgo! Installation.
libtensorflow
libtensorflow_framework
Static linkage is not supported in 2018.
Life of a deep learning model
- Research, debug
- Hyperparameter optimization
- Export
- Import
- Execution
Tensorflow model format zoo
- GraphDef = graph + [variable values*]
- Checkpoint = variable values
- Summary (aka Tensorboard) = GraphDef + key-value
- MetaGraph = GraphDef + tags + i/o + Checkpoint
- SavedModel = one or more MetaGraph-s
- ModuleDef (aka Hub) = special SavedModel
* 2GB limit.
Formats supported by Go
- GraphDef = graph + [variable values]
- SavedModel = one or more MetaGraph-s incompatible with ModuleDef
Imagenet
- 14.2mm labelled photos from Flickr
- 1000 classes
- Est. 2009, last rev. 2011
- State-of-the-art: 86% accuracy
- Deep learning hype ignition
- Link