--json
Description
Sets the directory (including the file name) of the .json file converted from an offline model, an original model file, or a GE dump graph.
The .json file converted from an offline model also records the versions of the infrastructure software such as ATC and OPP as well as the atc commands used during model conversion.
See Also
- To convert an offline model into a .json file:
- To convert an original model into a .json file:
Use this option in conjunction with --mode = 1, --om, and --framework.
If the original model uses the MindSpore framework, that is, --framework = 1, conversion to JSON files is not supported.
- To convert a GE dump graph into a .json file:
Use this option in conjunction with --mode = 5 and --om.
Only the dumped ge_proto*.txt file can be converted into a .json file.
Argument
Argument: Directory (including the file name) of the .json file.
Format: The directory (including the file name) can contain letters, digits, underscores (_), hyphens (-), periods (.), and Chinese characters.
Suggestions and Benefits
None
Example
- 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
- 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
Applicability
Dependencies and Restrictions
None