mirror of
https://github.com/Ascend/ascend_community_projects.git
synced 2025-09-26 20:01:17 +08:00
14 lines
1.0 KiB
Bash
14 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
# This is used to convert onnx model file to .om model file.
|
|
export install_path=/usr/local/Ascend/ascend-toolkit/latest
|
|
export PATH=/usr/local/python3.9.2/bin:${install_path}/arm64-linux/atc/ccec_compiler/bin:${install_path}/arm64-linux/atc/bin:$PATH
|
|
export PYTHONPATH=${install_path}/arm64-linux/atc/python/site-packages:${install_path}/arm64-linux/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/arm64-linux/atc/python/site-packages/schedule_search.egg
|
|
export LD_LIBRARY_PATH=${install_path}/arm64-linux/atc/lib64:$LD_LIBRARY_PATH
|
|
export ASCEND_OPP_PATH=${install_path}/opp
|
|
export Home="./path/"
|
|
# Home is set to the path where the model is located
|
|
|
|
# Execute, transform YOLOv5 model.
|
|
atc --model="${Home}"/YOLOv5_s.onnx --framework=5 --output="${Home}"/YOLOv5_s --insert_op_conf=./aipp_YOLOv5.config --input_format=NCHW --log=info --soc_version=Ascend310 --input_shape="images:1,3,640,640"
|
|
# --model is the path where onnx is located. --output is the path where the output of the converted model is located |