Category Archives: Amazon AWS

Deep Learning with the Movidius Neural Compute Stick


Deep Learning is a breakthrough in Artificial Intelligence. With its root from neural network, modern computing hardware advancement enabled new possibilities by sophisticated integrated circuits technology.

A branch of this exciting area in AI is machine learning. The leading development frameworks include TensorFlow and Caffe. Pattern recognition is a practical application of machine learning where photos or videos are analysed by machine to produce usable output as if a human did the analysis. GPU has been a favorite choice for its specialized architecture, delivering its supreme processing power not only in graphics processing but also popular among the neural network community. Covered in a previous installment is how to deploy an Amazon Web Services GPU instance to analyse real time traffic camera images using Caffe.

To bring this kind of machine learning power to IoT, Intel shrank and packaged a specialized Vision Processing Unit into the form factor of a USB thumb drive in the Movidius™ Neural Compute Stick.

It sports an ultra low power Vision Processing Unit (VPU) inside an aluminium casing, weights only 30g (without the cap). Supported on the Raspberry Pi 3 model B makes it a very attractive add-on for development projects involving AI application on this platform.IMAG1435

In the form factor of an USB thumb drive, the specialized VPU geared for machine learning in the Movidius performs as an AI accelerator for the host computer.IMAG1439

To put this neural compute stick into action, an SDK available from git download provided by Movidius is required. Although this SDK runs on Ubuntu, Windows users with VirtualBox can easily install the SDK with an Ubuntu 16.04 VM.

While the SDK comes with many examples, and the setup is a walk in the park, running these examples is not so straight forward, especially on a VM. There are points to note from making this stick available in the VM including USB 3 and filters setting in VirtualBox, to the actual execution of the provided sample scripts. Some examples required two sticks to run. Developers should be comfortable with Python, unix make / git commands, as well as installing plugins in Ubuntu.

The results from the examples in the SDK alone are quite convincing, considering the form factor of the stick and its electrical power consumption. This neural computing stick “kept its cool” literally throughout the test drive, unlike the FPGA stick I occasionally use for bitcoins mining which turn really hot.

Re-mounting an AWS EBS Volume to another instance

This is handy for a lot of reasons, like rescuing disk data or fixing boot configuration. The detail is here at the Amazon documentation. The outline of steps is below:

  1. Stop the original instance.
  2. Detach the volume from the stopped instance.
  3. Create a new instance of similar type to the original instance and assign the same security group.
  4. Start the new instance.
  5. Attach the detached original volume to the new instance as /dev/xvdf
  6. Login to the new instance, create mount point and mount the original volume.
  7. Once completed, umount the original volume and detach from the new instance.
  8. Attach the original volume to the original instance as /dev/sda1
  9. Start the original instance.

Essential commands for this, based on Ubuntu. Some steps above are done in the AWS Console GUI.

ubuntu:~$ lsblk
 xvda 202:0 0 8G 0 disk
xvda1 202:1 0 8G 0 part /
 xvdf 202:80 0 10G 0 disk
xvdf1 202:81 0 10G 0 part
ubuntu:~$ sudo file -s /dev/xvdf
 /dev/xvdf: x86 boot sector
ubuntu:~$ sudo mkdir /rescue
ubuntu:~$ sudo mount /dev/xvdf1 /rescue