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.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
||Runs online inference (batch_size=1).|
||Runs batch inference (batch_size=64).|
To run on bare metal, the following prerequisites must be installed in your environment:
Download and untar the model package and then run a quickstart script with enviornment variables that point to your 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> wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/transformer-lt-official-fp32-inference.tar.gz tar -xzf transformer-lt-official-fp32-inference.tar.gz cd transformer-lt-official-fp32-inference 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.
Documentation and Sources
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
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.