Giter Club home page Giter Club logo

cntk_amlworkbench's Introduction

CNTK 2.2 with Azure Machine Learning Workbench

The repo takes the FasterRCNN example from the CNTK samples GitHub repo and makes it run inside a docker container both locally and within a remote NC series data science VM in Azure complete with GPU support.

  • Derive a new docker container
  • Configure Conda dependencies

Videos

Some videos of this process:

Getting Started

In order to start create a new project in Azure Machine Learning Workbench and copy the files in this repo over to the new project directory.

Train

This project contains source images (created with VoTT) and code to train a model that can identify fluffy animals.

To train this model you can use environments created from the pre-made Docker and Conda configs in this repo.

Create a new Docker base image

The base docker image that is used by default (microsoft/mmlspark:plus-0.7.91) when creating new AML Workbench projects does not have all the dependencies installed that are required by CNTK 2.2 (it's actually OpenCV that is the problem).

Luckily it's possible to derive a new container from microsoft/mmlspark:plus-0.7.91 and add the dependencies required.

The supplied docker\dockerfile runs the required dependencies during build.

You can see the file is running the extra dependencies. Note some are commented out in the dockerfile - these are extra dependencies listed by OpenCV that were not required for this project.

RUN apt-get update
RUN apt-get -y install libpng-dev
RUN apt-get -y install libjasper-dev

To build your new container, run the following command from the Docker folder.

docker build -t reponame/imagename .

Once that is built edit docker.compute and update the baseDocker image.

baseDockerImage: "reponame/imagename"

Docker image for remote data science VM with support for GPU

See Running a script on a remote Docker for instructions in linking a remote Docker environment before continuing.

There is a different dockerfile and Conda file for GPU based machines.

Derive from the docker_gpu\dockerfile Make sure the .compute file reflects this new container name. Also make sure you use the conda_dependencies_gpu.yml file in the .runconfig file.

docker build -t reponame/imagename .

Once you've built the container, you'll have to push it up to Docker Hub so the remote data science VM can see it.

Get an account at Docker Hub then run the following commands:

docker login docker push reponame/imagename

Note: Your "reponame" is the name of your Docker Hub account.

Importantly make sure you add the following line to the .compute file:

nvidiaDocker: true

Now set up the remote environment by using the following command (where removeenvname is the name you used when you ran the az ml computetarget attach command.

az ml experiment prepare -c remoteenvname

Once complete you will be able to run your experiements by calling

az ml experiment submit -c remoteenvname

Pre-made containers

If you don't want to build and publish your own containers, you may use the premade ones:

  • jakkaj/ml for non-GPU
  • jakkaj/mlgpu for GPU

Train the model

Run az ml experiment submit -c docker or -c remoteenvname to run the experiment.

A nice way to run experiments in different environments is to use the Visual Studio Code Tools for AI Plugin.

The experiment will save the created model in the "output" folder. The system will download the AlexNet pre-trained model the first time it is run.

cntk_amlworkbench's People

Contributors

jakkaj avatar

Stargazers

dwkim avatar

Watchers

James Cloos avatar dwkim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.