diff --git a/docker/Dockerfile-arm64 b/docker/Dockerfile-arm64 index 0e1e732710..e9ab84c0ca 100644 --- a/docker/Dockerfile-arm64 +++ b/docker/Dockerfile-arm64 @@ -32,11 +32,6 @@ RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED RUN python3 -m pip install --upgrade pip wheel RUN pip install --no-cache -e ".[export]" -# Fix error: `np.object` was a deprecated alias for the builtin `object` when exporting to TensorFlow.js -# Here onnxruntime is installed first because in tflite and onnx simplify exports, it will install latest numpy version as a dependency and we need to downgrade it -RUN pip install --no-cache onnxruntime -RUN pip install --no-cache numpy==1.23.5 - # Creates a symbolic link to make 'python' point to 'python3' RUN ln -sf /usr/bin/python3 /usr/bin/python diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 6fff28e348..e36a12f851 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -886,6 +886,9 @@ class Exporter: def export_tfjs(self, prefix=colorstr("TensorFlow.js:")): """YOLOv8 TensorFlow.js export.""" check_requirements("tensorflowjs") + if ARM64: + # Fix error: `np.object` was a deprecated alias for the builtin `object` when exporting to TF.js on ARM64 + check_requirements("numpy==1.23.5") import tensorflow as tf import tensorflowjs as tfjs # noqa