Remove TFJS export for ARM64

remove-tfjs-arm64
lakbot 8 months ago
parent c6646830ed
commit 4fda8cdbda
  1. 2
      pyproject.toml
  2. 6
      ultralytics/engine/exporter.py

@ -102,7 +102,7 @@ export = [
"coremltools>=7.0; platform_system != 'Windows' and python_version <= '3.11'", # CoreML supported on macOS and Linux
"openvino>=2024.0.0", # OpenVINO export
"tensorflow>=2.0.0", # TF bug https://github.com/ultralytics/ultralytics/issues/5161
"tensorflowjs>=3.9.0", # TF.js export, automatically installs tensorflow
"tensorflowjs>=3.9.0"; platform_system != 'aarch64', # TF.js export, automatically installs tensorflow
"keras", # not installed automatically by tensorflow>=2.16
"flatbuffers>=23.5.26,<100; platform_machine == 'aarch64'", # update old 'flatbuffers' included inside tensorflow package
"numpy==1.23.5; platform_machine == 'aarch64'", # fix error: `np.bool` was a deprecated alias for the builtin `bool` when using TensorRT models on NVIDIA Jetson

@ -74,6 +74,7 @@ from ultralytics.nn.tasks import DetectionModel, SegmentationModel, WorldModel
from ultralytics.utils import (
ARM64,
DEFAULT_CFG,
IS_RASPBERRYPI,
IS_JETSON,
LINUX,
LOGGER,
@ -215,6 +216,8 @@ class Exporter:
elif self.args.batch != 1: # see github.com/ultralytics/ultralytics/pull/13420
LOGGER.warning("WARNING ⚠ Edge TPU export requires batch size 1, setting batch=1.")
self.args.batch = 1
if tfjs:
assert not (IS_RASPBERRYPI or IS_JETSON), "TF.js export not supported on Raspberry Pi and NVIDIA Jetson"
if isinstance(model, WorldModel):
LOGGER.warning(
"WARNING ⚠ YOLOWorld (original version) export is not supported to any format.\n"
@ -966,9 +969,6 @@ 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

Loading…
Cancel
Save