Check the preview of 2nd version of this platform being developed by the open MLCommons taskforce on automation and reproducibility as a free, open-source and technology-agnostic on-prem platform.

Image classification • MLPerf inference v0.5 • OpenVINO • MobileNet v1 1.0 224 • ImageNet • 500 images validation • Linux • benchmark • portable workflows

solution:mlperf-inference-v0.5-image-classification-openvino-mobilenet-imagenet-val-500-linux (v1.0.1)

Portable solution description  

Install and run this solution on your platform in several simple steps. Our goal is to make it simpler to reproduce results from research papers, participate in crowd-benchmarking, and enable "live" papers.
Don't hesitate to get in touch if you encounter any issues or would like to discuss this community project!

Check the prerequisites for your system  

Install manually from the command line (to be automated in the future):
# Tested on Ubuntu 18.04 
# (including Docker and Windows 10 Sybsystem for Linux)

 sudo apt update

 sudo apt install git wget libz-dev zip curl 
 sudo apt install python3 python3-pip
 sudo apt install gcc g++ autoconf autogen libtool cmake

Install cBench (docs)

Install cBench from the command line (a small Python library to manage CK solutions):
pip3 install cbench
 or 
python3 -m pip install cbench
 or
pip install cbench 
Note that you may need to add the --user flag if you install in your user space, i.e. "python3 -m pip install cbench --user"

Init this solution with the portable workflow on your machine

Run manually from your command line (cBench will attempt to automatically adapt this workflow to your system - you may need to press Enter several times to select default answers for some questions):
cb init mlperf-inference-v0.5-image-classification-openvino-mobilenet-imagenet-val-500-linux

Start cBench (status: disconnected)

cb start

Participate in collaborative crowd-benchmarking of this solution

or start crowd-benchmarking manually from the command line:
cb benchmark mlperf-inference-v0.5-image-classification-openvino-mobilenet-imagenet-val-500-linux

Run this workflow locally

or start local run manually from the command line:
cb run mlperf-inference-v0.5-image-classification-openvino-mobilenet-imagenet-val-500-linux

  # Note that the following CK program pipeline will be executed:
  ck compile program:mlperf-inference-v0.5 --cmd_key=image-classification --speed
  ck run program:mlperf-inference-v0.5 --cmd_key=image-classification

Successfully tested configuration

Host OS: linux-64 (Ubuntu 16.04.6 LTS)
Target OS: linux-64 (Ubuntu 16.04.6 LTS)
Target machine: Hewlett-Packard (HP Z640 Workstation)
Target CPU: Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
Target CPUs:
Python min version: 3.6
Python max version: 3.7.99

Dependencies    

Reused CK components

These components are automatically installed by cBench from this portal:
# Get stable components for the CK solution
cbench download package:lib-boost-1.67.0-without-python --force
cbench download package:mlperf-inference-source-ck --force
cbench download package:lib-openvino-ck --force


# Pull CK repositories (including ck-mlperf, ck-env, ck-autotuning, ck-tensorflow, ck-docker).
ck pull repo:ck-openvino

# Use generic Linux settings with dummy frequency setting scripts.
ck detect platform.os --platform_init_uoa=generic-linux-dummy

# Detect C/C++ compiler (gcc).
ck detect soft:compiler.gcc

# Detect CMake build tool.
#ck detect soft --tags=cmake --full_path=`which cmake`


# Install the latest Python package installer (pip) and some dependencies.
python -m pip install --ignore-installed pip setuptools



#-----------------------------------------------------------------------------#
# Step 1. Install Python dependencies (for Model Optimizer and LoadGen).
#-----------------------------------------------------------------------------#
# OpenVINO pre-release strictly requires TensorFlow < 2.0 and NetworkX < 2.4.
ck install package --tags=lib,python-package,tensorflow --force_version=1.15.2
ck install package --tags=lib,python-package,networkx --force_version=2.3.0
ck install package --tags=lib,python-package,defusedxml
# Cython is an implicit dependency of NumPy.
ck install package --tags=lib,python-package,cython
ck install package --tags=lib,python-package,numpy
# test-generator is an implicit dependency of Model Optimizer (not in requirements.txt).
ck install package --tags=lib,python-package,test-generator
# Abseil is a LoadGen dependency.
ck install package --tags=lib,python-package,absl


#-----------------------------------------------------------------------------#
# Step 2. Install C++ dependencies (for Inference Engine and MLPerf program).
#-----------------------------------------------------------------------------#
ck install package --tags=channel-stable,opencv,v3.4.3
ck install package:lib-boost-1.67.0-without-python
# Install LoadGen from a branch reconstructed according to Intel's README.
ck install package --tags=ck-mlperf,inference,source,dividiti.v0.5-intel
ck install package --tags=lib,loadgen,static
#-----------------------------------------------------------------------------#


#-----------------------------------------------------------------------------#
# Step 3. Install the OpenVINO "pre-release" used for MLPerf Inference v0.5.
#-----------------------------------------------------------------------------#
ck install package --tags=lib,ck-openvino,pre-release
ck compile ck-openvino:program:mlperf-inference-v0.5
#-----------------------------------------------------------------------------#


#-----------------------------------------------------------------------------#
# Step 4. Install the first 500 images of the ImageNet 2012 validation dataset.
# TODO: Create a calibration dataset.
#-----------------------------------------------------------------------------#
ck install package --tags=dataset,imagenet,val,min --no_tags=resized
ck install package --tags=dataset,imagenet,aux
# The OpenVINO program expects to find val_map.txt in the dataset directory.
head -n 500 `ck locate env --tags=aux`/val.txt > `ck locate env --tags=val`/val_map.txt
# Install misc Python dependencies required for calibration.
python  -m pip install nibabel pillow progress py-cpuinfo pyyaml shapely sklearn tqdm xmltodict yamlloader
# Install "headless" OpenCV (which doesn't need libsm6, libxext6, libxrender-dev).
ck install package --tags=lib,python-package,cv2,opencv-python-headless
#-----------------------------------------------------------------------------#


#-----------------------------------------------------------------------------#
# Step 6. Install the official MobileNet model for MLPerf Inference v0.5
# and convert it into the OpenVINO format.
#-----------------------------------------------------------------------------#
ck install package --tags=image-classification,model,tf,mlperf,mobilenet-v1-1.0-224,non-quantized
ck install package --tags=model,openvino,mobilenet --safe
#-----------------------------------------------------------------------------#

Comments  

Please log in to add your comments!
If you notice any inapropriate content that should not be here, please report us as soon as possible and we will try to remove it within 48 hours!