Pin `jax` and `jaxlib` to fix `tensorflowjs` exports (#6988)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/6990/head^2
Laughing 12 months ago committed by GitHub
parent 765b98f44e
commit d6be91d786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      requirements.txt
  2. 2
      setup.py
  3. 3
      ultralytics/engine/exporter.py

@ -32,6 +32,8 @@ seaborn>=0.11.0
# scikit-learn==0.19.2 # CoreML quantization
# tensorflow>=2.4.1,<=2.13.1 # TF exports (-cpu, -aarch64, -macos)
# tflite-support
# jax<=0.4.21 # tensorflowjs bug https://github.com/google/jax/issues/18978
# jaxlib<=0.4.21 # tensorflowjs bug https://github.com/google/jax/issues/18978
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev>=2023.0 # OpenVINO export

@ -81,6 +81,8 @@ setup(
'coremltools>=7.0',
'openvino-dev>=2023.0',
'tensorflow<=2.13.1', # TF bug https://github.com/ultralytics/ultralytics/issues/5161
'jax<=0.4.21', # tensorflowjs bug https://github.com/google/jax/issues/18978
'jaxlib<=0.4.21', # tensorflowjs bug https://github.com/google/jax/issues/18978
'tensorflowjs', # automatically installs tensorflow
], },
classifiers=[

@ -781,7 +781,8 @@ class Exporter:
@try_export
def export_tfjs(self, prefix=colorstr('TensorFlow.js:')):
"""YOLOv8 TensorFlow.js export."""
check_requirements('tensorflowjs')
# JAX bug requiring install constraints in https://github.com/google/jax/issues/18978
check_requirements(['jax<=0.4.21', 'jaxlib<=0.4.21', 'tensorflowjs'])
import tensorflow as tf
import tensorflowjs as tfjs # noqa

Loading…
Cancel
Save