Model Visualization

The Model Visualizer of MindStudio allows you to view the network topology and operators of an original model (.pb, .onnx, or .prototxt) or a generated offline model (.om) in a visualized way. The following uses the .om model file as an example to describe the model visualization function.

Prerequisites

If the Linux environment uses the AArch64 architecture and the glibc version in the system is earlier than 2.29, the model visualization function of MindStudio cannot be used. For details about how to rectify the fault, see What Do I Do If Model Visualization Is Unavailable Because the glibc Version Is Too Early?.

Procedure

  1. Choose Ascend > Model Visualizer or click on the menu bar. In the dialog box displayed, select a model file to be visualized, for example, resnet50.
    • Figure 1 shows the model visualization function in a Linux environment.
      Figure 1 Selecting a model to be visualized (Linux)
    • Figure 2 shows the model visualization function in a Windows environment.
      Figure 2 Selecting a model to be visualized (Windows)

      When viewing the .prototxt model file, ensure that the .prototxt model file and the related .caffemodel weight file are in the same directory.

  2. Double-click the resnet50.om model file or click OK to open the model visualization page, as shown in Figure 3.
    Figure 3 Model visualization page

Description of the Model Visualization GUI

  • View the operator details.

    All operators in the model file are displayed in area 1 in Figure 3. If you select an operator, the operator is outlined green and all its details are displayed in area 3, including the operator name and the inputs and outputs.

    Area 2 shows the general structure of the network model, including the context (outlined in blue) of the operator selected in area 3 on the network.

    • You can scroll the mouse wheel up or down to move the view upward or downward.
    • You can press and hold Ctrl and scroll the mouse wheel up and down to zoom in or zoom out the view.
  • View the output format and shape of an operator.

    Area 1 in Figure 3 also displays the shape information output by operators at each layer, for example, the 1,224,224,4 in the middle of the connection line.

  • Search for an operator.

    Enter the operator name in the text box of Find in area 4 in Figure 3. The corresponding operator is displayed in the search area below. Select an operator, which adds a green outline to the operator in area 1. The details about the operator are displayed in area 3. See Figure 4.

    Figure 4 Searching for an operator
  • Find operator details.

    Select a layer of operators in area 1, enter the information to be queried in the text box next to in area 3, such as the input, output, and attributes of an operator, and click . If related information is matched, it is highlighted in area 3; otherwise, the message "Value not found" is displayed in the Output window.

  • View the model output nodes.

    If the output operator is set through the selected node during model conversion, the output of the selected operator is directly used as the model output in the .om model file. You can click the corresponding operator to view its input information.

  • View the data types of the model output nodes.

    If the output type of the selected node is set during model conversion, ensure that it is consistent with Data Type in the Output Nodes area on the Model Information tab page in Script Conversion. After model conversion is complete, you can click the corresponding node to view the data types of different input nodes.

    If only Output Type in the Model Information tab page is set during model conversion and no node is selected as the output, click the corresponding node to view the input data type after model conversion is complete.

    If dtype is DT_FLOAT, the output data type is FP32. If dtype is DT_FLOAT16, the output data type is FP16. If dtype is DT_UINT8, the output data type is UINT8.

Other Operations

AArch64 architecture in the Linux environment

Ubuntu OS: https://mindstudio-sample.obs.cn-north-4.myhuaweicloud.com/glibc/euler-os/glibc-2.29.tar.gz

EulerOS: https://mindstudio-sample.obs.cn-north-4.myhuaweicloud.com/glibc/euler-os/glibc-2.29.tar.gz