Skip to content

Commit 7cb3b7a

Browse files
authored
Add downgrade fix for ONNX error during RKNN conversion (#2136)
1 parent 054ed8b commit 7cb3b7a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scripts/rknn-convert-tool/create_onnx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def run_onnx_conversion_yolov5(model_path):
8282
"-r",
8383
os.path.join(ultralytics_folder_name_yolov5, "requirements.txt"),
8484
"torch<2.6.0",
85-
"onnx",
85+
"onnx==1.18.0",
86+
"onnxscript",
8687
]
8788
)
8889

@@ -121,7 +122,9 @@ def run_onnx_conversion_yolov5(model_path):
121122

122123
def run_onnx_conversion_no_anchor(model_path):
123124
check_or_clone_rockchip_repo(yolo_non_anchor_repo)
124-
run_pip_install_or_else_exit(["-e", ultralytics_default_folder_name, "onnx"])
125+
run_pip_install_or_else_exit(
126+
["-e", ultralytics_default_folder_name, "onnx==1.18.0", "onnxscript"]
127+
)
125128

126129
sys.path.insert(0, os.path.abspath(ultralytics_default_folder_name))
127130
model_abs_path = os.path.abspath(model_path)

scripts/rknn-convert-tool/rknn_conversion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"\n",
110110
"#### Automatic installation\n",
111111
"\n",
112-
"Please run `pip` below. If it does not work, refer to the instructions for manual installation.\n"
112+
"Please run `pip` below. If it does not work, refer to the instructions for manual installation. You may need to restart your session after running the command below.\n"
113113
]
114114
},
115115
{

0 commit comments

Comments
 (0)