--om

Description

Sets the directory (including the file name) of your offline model (.om), original model (.prototxt for Caffe or .pb for TensorFlow), or GE dump graph (.txt) to be converted.

See Also

  • If --mode is set to 1:
    • To convert an offline model into a .json file:

      Use this option in conjunction with --mode = 1 and --json.

    • To convert an original model into a .json file:

      Use this option in conjunction with --mode = 1, --json, and --framework.

  • If --mode is set to 5:

    To convert a GE dump graph into a .json file, use this option in conjunction with --mode = 5 and --json.

  • If --mode is set to 6:

    To display model details of an existing offline model, use --om with --mode.

Argument

Argument: Directory (including the file name) of your offline model (.om), original model (.prototxt for Caffe or .pb for TensorFlow), or GE dump graph (.txt) to be converted.

Format: The directory (including the file name) can contain letters, digits, underscores (_), hyphens (-), periods (.), and Chinese characters.

Suggestions and Benefits

None

Example

  • If --mode is set to 1:
    • To convert an offline model into a .json file:
      --mode=1 --om=$HOME/module/out/tf_resnet50.om  --json=$HOME/module/out/tf_resnet50.json

      In the output .json file, you can view the basic version number of the original model and the atc command used for conversion. The following is an example:

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
         {
            "key": "opp_version",
            "value": {
              "s": "<version>"
            }
          },
          ...
          {
            "key": "atc_version",
            "value": {
              "s": "<version>"
            }
          },
          ...
      
          { 
             "key": "atc_cmdline",
             "value": {
               "s": "xxx/atc.bin --model ./resnet50_tensorflow*.pb  --framework 3 --output ./out/tf_resnet50 --soc_version <soc_version>"
             }
           },
          ...
          {
            "key": "soc_version",
            "value": {
              "s": "<soc_version>"
             }
           },
          ...
      
    • To convert an original model into a .json file:
      --mode=1 --om=$HOME/module/resnet50_tensorflow*.pb  --json=$HOME/module/out/tf_resnet50.json  --framework=3
  • If --mode is set to 5:
    To convert a GE dump graph into a .json file:
    --mode=5 --om=$HOME/module/ge_proto_00000000_PreRunBegin.txt --json=$HOME/module/out/ge_proto.json
  • If --mode is set to 6:
    atc --mode=6 --om=$HOME/module/out/tf_resnet50.om

Applicability

Atlas 200/300/500 Inference Product

Atlas Training Series Product

Dependencies and Restrictions

None