Skip to content

Commit

Permalink
Limit tensorflow version and add checks (#12494)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Corallo and pre-commit-ci[bot] authored Dec 16, 2023
1 parent f400bba commit a04b49f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a04b49f

Please sign in to comment.