Skip to content
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This document has instructions for how to run UNet for the following modes/precisions:

FP32 Inference Instructions

  1. Clone this intelai/models repository:

    $ git clone

    This repository includes launch scripts for running benchmarks.

  2. Download and extract the pretrained model:

    $ wget
    $ tar -xvf unet_fp32_pretrained_model.tar.gz
  3. Clone the tf_unet repository, and then get PR #202 to get cpu optimizations:

    $ git clone
    $ cd tf_unet/
    $ git fetch origin pull/202/head:cpu_optimized
     * [new ref]         refs/pull/202/head -> cpu_optimized
    $ git checkout cpu_optimized
    Switched to branch 'cpu_optimized'
  4. Navigate to the benchmarks directory in your local clone of the intelai/models repo from step 1. The script in the benchmarks directory is used for starting a benchmarking run in a optimized TensorFlow docker container. It has arguments to specify which model, framework, mode, precision, and docker image to use, along with the checkpoint files that were downloaded in step 2 and the path to the UNet model repository that you cloned in step 3.

    UNet benchmarking can be run to test throughput and latency using the following command with your checkpoint and model-source-dir paths:

    python \
        --model-name unet \
        --precision fp32 \
        --mode inference \
        --framework tensorflow \
        --benchmark-only \
        --batch-size 1 \
        --socket-id 0 \
        --docker-image intelaipg/intel-optimized-tensorflow:latest-devel-mkl \
        --checkpoint /home/<user>/unet_trained \
        --model-source-dir /home/<user>/tf_unet \
        -- checkpoint_name=model.cpkt

    Note that the --verbose or --output-dir flag can be added to the above command to get additional debug output or change the default output location.

  5. The log file is saved to the value of --output-dir.

    Below is an example of what the log file tail:

    Time spent per BATCH: 1.1043 ms
    Total samples/sec: 905.5344 samples/s
    lscpu_path_cmd = command -v lscpu
    lscpu located here: /usr/bin/lscpu
    Ran inference with batch size 1
    Log location outside container: {--output-dir value}/benchmark_unet_inference_fp32_20190201_205601.log
You can’t perform that action at this time.