Help Center> ModelArts> FAQs> Model Management> Compressing and Converting Models> How Do I Convert a Local Model to a Model That Can Run on Ascend Chips?

How Do I Convert a Local Model to a Model That Can Run on Ascend Chips?

ModelArts allows you to convert local models into multiple formats of models that can run on different types of chips.

ModelArts supports model conversion in the following scenarios:

  • If you use the Caffe (in .caffemodel format) or TensorFlow framework (in frozen_graph or saved_model format) to train a model, you can convert the model to the .om format. The converted model can be deployed and run on Ascend chips.
  • If you use the TensorFlow framework to train a model (in frozen_graph or saved_model format), you can convert the model to the .tflite format. The converted model can be deployed and run on Arm.
  • If you use the TensorFlow framework to train a model (in frozen_graph or saved_model format), you can convert the model to the TensorRT format. The converted model can be deployed and run on the NVIDIA Tesla P4 GPU.

For details, see Compressing and Converting Models.

Format Description

caffemode

|
|---xxxx.caffemodel         Mandatory. Model parameter file. Only one such file can exist in the input path.
|---xxxx.prototxt           Mandatory. Model network file. Only one such file can exist in the input path.
|---insert_op_conf.cfg      Optional. Insertion operator configuration file. Only one such file can exist in the input path.
|---plugin                  Optional. Custom operator directory. Only one such plugin folder can exist in the input path. Only custom operators developed based on Tensor Engine (TE) are supported.
frozen_graph
|
|---xxxx.pb                 Mandatory. Model network file. Only one such file can exist in the input path. The model must be in frozen_graph or saved_model format.
|---insert_op_conf.cfg      Optional. Insertion operator configuration file. Only one such file can exist in the input path.
|---plugin                  Optional. Custom operator directory. Only one such plugin folder can exist in the input path. Only custom operators developed based on Tensor Engine (TE) are supported.

saved_model

|
|---saved_model.pb          Mandatory. Model network file. Only one such file can exist in the input path. The model must be in frozen_graph or saved_model format.
|---variables               Mandatory. Fixed subdirectory name, including the model weight deviation.
    |---variables.index     Mandatory
    |---variables.data-00000-of-00001 Mandatory
|---insert_op_conf.cfg      Optional. Insertion operator configuration file. Only one such file can exist in the input path.
|---plugin                  Optional. Custom operator directory. Only one such plugin folder can exist in the input path. Only custom operators developed based on Tensor Engine (TE) are supported.