Import Original Model

To import original model in the DL Workbench, you need to:

  1. Upload a model.

  2. Prepare Environment.

  3. Convert the model to Intermediate Representation (IR).

  4. Configure Model Inputs.

1. Upload Original Models

In the DL Workbench, you can upload original models stored on your operating system.

Click Create Project on the Start Page to import a model:

../_images/create_project_original.png

Click Import Model and Select the Model Domain: Computer Vision (CV) or Natural Language Processing (NLP). The uploading process depends on the framework of your model. This section contains requirements for each supported framework:

pages/_static/images/import_frameworks.png

2. Prepare Environment

At the Prepare Environment stage, the DL Workbench installs the necessary packages to work with the model framework. For each framework, the download happens only once and takes from two to five minutes. If the environment setup is successful, you will automatically proceed to the next step. Otherwise, look for a solution in Troubleshooting.

3. Convert Models to Intermediate Representation (IR)

To work with OpenVINO tools, you need to obtain a model in the Intermediate Representation (IR) format. IR is the OpenVINO format of pre-trained model representation with two files:

  • XML file describing the network topology

  • BIN file containing weights and biases

Note

For details on converting process, refer to Converting a Model to Intermediate Representation document.

General Parameters

Specify the converted model precision and select the original color space for Computer Vision models.

  • Precision of a converted model: FP16 or FP32

  • Original color space (for CV models): RGB, BGR, Grayscale

../_images/convert_general_parameters.png

Configuration Files

You can upload a Model Conversion Configuration File that contains the description of the necessary transformations required to convert a model to IR. Learn more about configuration files in the Model Optimizer documentation.

Note

When importing TensorFlow* models, provide an additional pipeline configuration file and choose a model conversion configuration file.

Inputs

On this step you can specify the inputs of your model. This is an optional step, if your model does not require any additional conversion configurations or belongs to the NLP domain, just click Convert to proceed to the next step.

Check Specify Inputs (Optional) box, if the model requires additional conversion settings, such as:

  • changing the outputs;

  • marking the input nodes;

  • providing means and scales applied at the model training stage.

Advanced Parameters

In the Advanced Parameters, you can use default output layers or cut a model by specifying the layers you want to consider as output ones.

For details on converting models from the supported frameworks, refer to the corresponding documentation:

4. Configure Model Inputs

If the conversion step is completed successfully, you will obtain a model in the IR format. However, to use it in the OpenVINO tools (for example, benchmark the model, optimize it, and measure accuracy), you need to specify model layouts. Learn more about layouts in the documentation.

../_images/configure_input.png

Layout describes the role of each dimension of input tensors.

Computer Vision Models:

Layout Role

Description

Batch (N)

number of images in the batch

Height (H)

image height

Width (W)

image width

Channels (C)

number of image channels (3 for RGB/BGR, 1 for Grayscale)

Depth

depth of the data with which the model works

Other

any other dimension role that does not refer to the number of channels or batch

The role of dimensions may differ depending on the model and the way the data was fed to the model during training. Usually, NCHW is used for ONNX models, and NHWC for TensorFlow models. If you want to specify different dimension roles, select Custom.

Natural Language Processing Models:

Layout Role

Description

Batch (N)

number of text samples in the batch

Channels (C)

maximum length of text that the model can process

Other

any other dimension role that does not refer to the number of channels or batch

The role of dimensions may differ depending on the model and the way the data was fed to the model during training. Usually, NCHW is used for ONNX models, and NHWC for TensorFlow models. If you want to specify different dimension roles, select Custom.

Once you click Validate and Import, you are redirected to the Create Project page, where you can select the model, analyze it and proceed to select a dataset.

See Also