diff --git a/scripts/rknn_conversion.ipynb b/scripts/rknn_conversion.ipynb index 3b33801b7..00d1ac34f 100644 --- a/scripts/rknn_conversion.ipynb +++ b/scripts/rknn_conversion.ipynb @@ -33,6 +33,27 @@ ], "id": "500d656b7cc0ebd7" }, + { + "metadata": {}, + "cell_type": "markdown", + "source": [ + "#### *Numpy Fix* - Important for Google Colab Users\n", + "\n", + "Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted." + ], + "id": "b3a9e1a334bce144" + }, + { + "metadata": {}, + "cell_type": "code", + "outputs": [], + "execution_count": null, + "source": [ + "%pip uninstall numpy -y\n", + "%pip install \"numpy==1.26.4\"" + ], + "id": "7156e69495f48f49" + }, { "metadata": {}, "cell_type": "markdown", @@ -41,7 +62,7 @@ "\n", "Please run the cell below to be able to use the `create_onnx` and `create_rknn` functions." ], - "id": "798298b1dbe33d2d" + "id": "51566ff74470e57" }, { "metadata": {}, @@ -132,6 +153,7 @@ " os.path.join(ultralytics_folder_name_yolov5, \"requirements.txt\"),\n", " \"torch<2.6.0\",\n", " \"onnx==1.18.0\",\n", + " \"numpy==1.26.4\",\n", " \"onnxscript\",\n", " ]\n", " )\n", @@ -172,7 +194,7 @@ "def run_onnx_conversion_no_anchor(model_path):\n", " check_or_clone_rockchip_repo(yolo_non_anchor_repo)\n", " run_pip_install_or_else_exit(\n", - " [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"onnxscript\"]\n", + " [\"-e\", ultralytics_default_folder_name, \"onnx==1.18.0\", \"numpy==1.26.4\", \"onnxscript\"]\n", " )\n", "\n", " sys.path.insert(0, os.path.abspath(ultralytics_default_folder_name))\n", @@ -384,28 +406,7 @@ " except SystemExit:\n", " print(\"RKNN Conversion failed, see output above\")\n" ], - "id": "ea6869140a61126d" - }, - { - "metadata": {}, - "cell_type": "markdown", - "source": [ - "#### *Numpy Fix* - Important for Google Colab Users\n", - "\n", - "Google Colab comes with an incompatible version of Numpy installed. To fix this, please run the following cells below and **restart your session** when prompted." - ], - "id": "b3a9e1a334bce144" - }, - { - "metadata": {}, - "cell_type": "code", - "outputs": [], - "execution_count": null, - "source": [ - "%pip uninstall numpy -y\n", - "%pip install \"numpy>=1.23.0,<2.0.0\"" - ], - "id": "7156e69495f48f49" + "id": "4d7a8adee7a03377" }, { "metadata": {},