Transformer-LT Official FP32 Inference Tensorflow* Container

Published: 10/23/2020  

Last Updated: 06/15/2022

Pull Command

docker pull intel/language-translation:tf-latest-transformer-lt-official-fp32-inference

Description

This document has instructions to run a Transformer Language Translation FP32 inference using Intel® Optimization for TensorFlow*. The original code for the Transformer LT Official model came from the TensorFlow Model Garden repository.

Download and preprocess the English-German dataset using the data_download.py script from the TensorFlow Model Garden repo. The Transformer model README has a section with instructions for using the script.

Once the script completes, you should have a dataset directory with the following files: newstest2014.denewstest2014.en, and a vocab text file. For simplicity, rename the vocab file to vocab.txt. The path to the directory with these files should be set as the DATASET_DIR environment variable when using the quickstart scripts.

Quick Start Scripts

Script name Description
fp32_online_inference Runs online inference (batch_size=1).
fp32_batch_inference Runs batch inference (batch_size=64).

Docker*

The model container used in the example below includes the scripts, libraries, and pretrained model needed to run Transformer LT Official FP32 inference. To run one of the model quickstart scripts using this container, you'll need to provide volume mounts for the dataset and an output directory.

DATASET_DIR=<path to the test dataset directory>
OUTPUT_DIR=<directory where the log and translation file will be written>

docker run \
  --env DATASET_DIR=${DATASET_DIR} \
  --env OUTPUT_DIR=${OUTPUT_DIR} \
  --env http_proxy=${http_proxy} \
  --env https_proxy=${https_proxy} \
  --volume ${DATASET_DIR}:${DATASET_DIR} \
  --volume ${OUTPUT_DIR}:${OUTPUT_DIR} \
  --privileged --init -t \
  intel/language-translation:tf-latest-transformer-lt-official-fp32-inference \
  /bin/bash quickstart/<script name>.sh

If you have your own pretrained model, you can specify the path to the frozen graph .pb file using the FROZEN_GRAPH environment variable and mount the frozen graph's directory as a volume in the container.


Documentation and Sources

Get Started​
Docker* Repository
Main GitHub*
Readme
Release Notes
Get Started Guide

Code Sources
Dockerfile
Report Issue


License Agreement

LEGAL NOTICE: By accessing, downloading or using this software and any required dependent software (the “Software Package”), you agree to the terms and conditions of the software license agreements for the Software Package, which may also include notices, disclaimers, or license terms for third party software included with the Software Package. Please refer to the license file for additional details.


Related Containers and Solutions

Transformer-LT Official FP32 Inference TensorFlow* Model Package

View All Containers and Solutions 🡢

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.