Limit tensorflow version and add checks (#12494)

* Limit tensorflow version and add checks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Moving check in export script

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Angelo Delli Santiandpre-commit-ci[bot] authored and GitHub committed 2023-12-16 23:31:22 +01:00
1 parent f400bba783
commit a04b49f1aa
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -397,6 +397,11 @@ def export_saved_model(model,
from models.tf import TFModel
LOGGER.info(f'\n{prefix} starting export with tensorflow {tf.__version__}...')
if tf.__version__ > '2.13.1':
helper_url = 'https://github.com/ultralytics/yolov5/issues/12489'
LOGGER.info(
f'WARNING ⚠️ using Tensorflow {tf.__version__} > 2.13.1 might cause issue when exporting the model to tflite {helper_url}'
) # handling issue https://github.com/ultralytics/yolov5/issues/12489
f = str(file).replace('.pt', '_saved_model')
batch_size, ch, *imgsz = list(im.shape) # BCHW
+1 -1
View File
@@ -34,7 +34,7 @@ seaborn>=0.11.0
# nvidia-pyindex # TensorRT export
# nvidia-tensorrt # TensorRT export
# scikit-learn<=1.1.2 # CoreML quantization
# tensorflow>=2.4.0 # TF exports (-cpu, -aarch64, -macos)
# tensorflow>=2.4.0,<=2.13.1 # TF exports (-cpu, -aarch64, -macos)
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev>=2023.0 # OpenVINO export