Reader small image

You're reading from  Caffe2 Quick Start Guide

Product typeBook
Published inMay 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781789137750
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Ashwin Nanjappa
Ashwin Nanjappa
author image
Ashwin Nanjappa

Ashwin Nanjappa is a senior architect at NVIDIA, working in the TensorRT team on improving deep learning inference on GPU accelerators. He has a PhD from the National University of Singapore in developing GPU algorithms for the fundamental computational geometry problem of 3D Delaunay triangulation. As a post-doctoral research fellow at the BioInformatics Institute (Singapore), he developed GPU-accelerated machine learning algorithms for pose estimation using depth cameras. As an algorithms research engineer at Visenze (Singapore), he implemented computer vision algorithm pipelines in C++, developed a training framework built upon Caffe in Python, and trained deep learning models for some of the world's most popular online shopping portals.
Read more about Ashwin Nanjappa

Right arrow

Caffe2 at the Edge and in the cloud

In chapters 1-6 of this book, we have learned how to install and use Caffe2 to train DL neural networks and how to work with other popular DL frameworks. We have also learnt how to deploy our trained Caffe2 models on popular inference engines. In this last chapter, we will look at applications of Caffe2 that exploit its ability to scale from tiny edge devices such as the Raspberry Pi to running on containers in the cloud. We will also look at visualizing Caffe2 models.

The topics that will be covered in this chapter are as follows:

  • Caffe2 at the edge on Raspberry Pi
  • Caffe2 in the cloud using containers
  • Caffe2 model visualization

Caffe2 at the edge on Raspberry Pi

There is a lot of interest in using deep learning at the edge. This is the application of deep learning to compute solutions on or near the devices that capture data using sensors and cameras. An alternative solution to deep learning at the edge is to capture edge data and send it to in the cloud for processing. But, deep learning at the edge has the advantage of lower latency and higher security. Devices at the edge are typically cheap, have a small form factor and use less power, and their processors or accelerators have less compute capability. One of the key advantages of Caffe2 is that it has been designed and developed from the beginning to scale: from multi-GPU, multi-CPU servers, down to tiny edge devices. In this section, we will use the Raspberry Pi as an example of an edge device and learn how to use Caffe2 on it.

...

Caffe2 in the cloud using containers

Containers are now a ubiquitous and necessary tool for robustly deploying software in production, both locally and in the cloud. They enable developers to create the ideal software environment for the application and ensure that this software environment is exactly replicated on developer workstations, test computers, staging computers, and the final deployment to local servers or instances in the cloud. Containers also help create a sanitized software environment for every single application, enabling multiple software environments, one for each application, when multiple applications are running on the same server.

Among the many available container tools, Docker is the most popular. We will focus on using Docker in this section. Docker is available for all popular Linux distributions, macOS X, and Windows. With Docker, you can create an...

Caffe2 model visualization

DL models contain a high number of layers. Layers have many parameters, such as their name, type, weight dimensions, layer-type-specific parameters, input, and output tensor names. While typical feedforward network structures do not have cycles, the Recurrent Neural Network (RNN) and other network structures have cycles and other topologies. So, the ability to visualize the structure of a DL model is important, both for researchers devising new networks to solve problems, and for practitioners using new networks.

Visualization using Caffe2 net_drawer

Caffe2 ships with a simple visualization tool written in Python named net_drawer. This Python script can be found in your Caffe2 installation directory...

Summary

In the final chapter of this guide, we looked at two applications of Caffe2 that demonstrate its ability. As an application of Caffe2 to edge devices, we looked at how to build Caffe2 on the Raspberry Pi single-board computers and run Caffe2 applications on them. As an application of Caffe2 to the cloud, we looked at how to build and run Caffe2 applications inside Docker containers. As an aid to understanding the structure of DL models, we examined two tools that helped in the visualization of Caffe2 models.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Caffe2 Quick Start Guide
Published in: May 2019Publisher: PacktISBN-13: 9781789137750
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ashwin Nanjappa

Ashwin Nanjappa is a senior architect at NVIDIA, working in the TensorRT team on improving deep learning inference on GPU accelerators. He has a PhD from the National University of Singapore in developing GPU algorithms for the fundamental computational geometry problem of 3D Delaunay triangulation. As a post-doctoral research fellow at the BioInformatics Institute (Singapore), he developed GPU-accelerated machine learning algorithms for pose estimation using depth cameras. As an algorithms research engineer at Visenze (Singapore), he implemented computer vision algorithm pipelines in C++, developed a training framework built upon Caffe in Python, and trained deep learning models for some of the world's most popular online shopping portals.
Read more about Ashwin Nanjappa