ultralytics 8.2.25 latest TensorFlow 2.16 support (#13176)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: lakshanthad <lakshanthad@yahoo.com>
This commit is contained in:
Glenn Jocher 2024-05-29 12:40:27 +02:00 committed by GitHub
parent d80bd840d1
commit dd819fc420
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 79 additions and 49 deletions

View file

@ -83,7 +83,6 @@ from ultralytics.utils import (
WINDOWS,
__version__,
callbacks,
checks,
colorstr,
get_default_args,
yaml_save,
@ -813,15 +812,16 @@ class Exporter:
import tensorflow as tf # noqa
except ImportError:
suffix = "-macos" if MACOS else "-aarch64" if ARM64 else "" if cuda else "-cpu"
version = "" if ARM64 else "<=2.13.1"
check_requirements((f"tensorflow{suffix}{version}", "keras"))
version = ">=2.0.0"
check_requirements(f"tensorflow{suffix}{version}")
import tensorflow as tf # noqa
if ARM64:
check_requirements("cmake") # 'cmake' is needed to build onnxsim on aarch64
check_requirements(
(
"keras",
"onnx>=1.12.0",
"onnx2tf>=1.15.4,<=1.17.5",
"onnx2tf>1.17.5,<=1.22.3",
"sng4onnx>=1.0.1",
"onnxsim>=0.4.33",
"onnx_graphsurgeon>=0.3.26",
@ -835,7 +835,7 @@ class Exporter:
LOGGER.info(f"\n{prefix} starting export with tensorflow {tf.__version__}...")
check_version(
tf.__version__,
"<=2.13.1",
">=2.0.0",
name="tensorflow",
verbose=True,
msg="https://github.com/ultralytics/ultralytics/issues/5161",