--framework or -f
Description
Sets the framework of the original network model.
See Also
None
Arguments
Arguments:
- 0: Caffe
- 1. Model file in .air format of the MindSpore framework or standard .air file exported from TorchAir through export
- 3: TensorFlow
- 5: ONNX
Restrictions:
This option is optional. If it is not set, the model framework is identified based on the specified model file name extension. The identification rules are as follows:
- If the model file name extension is .prototxt, the system identifies the model as a Caffe model.
- If the model file name extension is .air, the system identifies the model as a MindSpore model.
- If the model file name extension is .pb, the system identifies the model as a TensorFlow model.
- If the model file name extension is .onnx, the system identifies the model as an ONNX model.
- If the model file name extension is other value, the system identifies the model as a graph dumped using the aclGenGraphAndDumpForOp API.
If this option is set, the restrictions are as follows:
- If this option is set to 0, the Caffe network model is used. The model includes a .prototxt model file and a .caffemodel weight file. The op name and op type fields of the two files must be the same (case-sensitive).
- If this option is set to 3, the TensorFlow network model is used. Only the frozen GraphDef format is supported, that is, the model file with a .pb file name extension is supported. The .pb file is stored in Protobuf format. The network model and weight data are stored in the same file.
- If this option is set to 5, the ONNX network model is used. Only operators in ai.onnx opset v11 are supported. You can also convert operators of other opset versions (for example, opset v9) into opset v11 ONNX operators using PyTorch. The .pth model trained using PyTorch needs to be converted into the ONNX format first.
- If this option is set to 1, the MindSpore network model is used. In this case, note the following restrictions:
- Only model files in .air format can be tuned.
- --input_format can only be set to NCHW. The --out_nodes, --is_output_adjust_hw_layout, --input_fp16_nodes, --is_input_adjust_hw_layout, and --op_name_map options cannot be used in the MindSpore framework.
Suggestions and Benefits
None
Examples
--framework=0 --model=${HOME}/test/resnet50.prototxt --weight=${HOME}/test/resnet50.caffemodel
Dependencies and Restrictions
None
Parent topic: Basic Functionality